Giter Site home page Giter Site logo

kevinostoll-zz / stackato-ad-import Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bowdeng/stackato-ad-import

0.0 0.0 0.0 6 KB

Import organisations from Active Directory groups and then import member users into Stackato as "users" in those Orgs

Python 100.00%

stackato-ad-import's Introduction

stackato-ad-import

Import organisations from Active Directory groups and then import member users into Stackato as "users" in those Orgs

Installation

pip install -r requirements

Currently the script also relies on the stackato client being on the path. This has only been tested on MacOS and *NIX currently, Windows would probably need the path modifying.

I have found it simplest to run this from the root of the Stackato controller VM itself. In order to install the requirements however I executed the following...

sudo apt-get install python-ldap

Usage

Modify the variables at the top of the script to match your environment.

(TODO: Pull this out to a YAML config file)

ldapstring = "ldap://10.12.0.11"                                  # String to define the host and protocol to connect to AD via LDAP
adusername = "CN=stackadmin,ou=HPE,dc=adtest,dc=hpcloud,dc=net"   # The DN for the user used to bind to AD. Requires Read access
adpassword = "Hpinvent01"                                         # Password for the bind user
basedn = "ou=HPE,dc=adtest,dc=hpcloud,dc=net"                     # DN for the OU from which to import the groups as orgs
userbasedn = "dc=adtest,dc=hpcloud,dc=net"                        # DN to start searching for the users (can be different from basedn)
groupfilter = "Org*"                                              # Filter on the groupname to select which groups to import
ldfilter = "(&(cn=" + groupfilter + ")(objectCategory=group))"    # Full group filter string
stacktarget = "api.stackato.adtest.hpcloud.net"                   # Stackato Endpoint address
stackuser = "stackato"                                            # Stackato admin user
stackpassword = "Hpinvent01"                                      # Stackato admin address
stackdefaultpassword = "Hpinvent01"                               # The default password to give to all imported users
defaultspace = "default"                                          # The name of the space to create in all new orgs

Execute the script with the following... (It requires Python 2.7)

python stack-ad-import.py

The script will automatically gather all users and import the organisation and users without any further prompts! Ensure this is what you intened to do and that your BASE DN and filters are correct! The script currently does not include nested users, so if a user is only a member of a group that is a member of the target group, they will not be included.

stackato-ad-import's People

Contributors

bowdeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.