GithubHelp home page GithubHelp logo

update_ad's Introduction

update-ad.py

Intro

Update-ad.py is a Python script to update different properties of AD user in batch. Properties can be many. See below detail description for how to define the properties to update.

Install

  • python3.5+

  • virtualenv

    pip install virtualenv
    virtualenv ad-venv
    ad-venv\Scripts\activate
    

    That will install and activate a virtual environment

  • openpyxl, pyad, pywin32

    pip install openpyxl pyad pywin32
    

    That will install the openpyxl pyad and pywin32 modules

  • update-ad.py

    git clone https://github.com/plj611/update_ad.git
    

Execute

cd update_ad
python update-ad.py

Detail description

update-ad.py reads the information from an Excel file and the file should place in the same directory as of update-ad.py

Below shows the layout of the Excel file

e

Column A is the canonical name of the user object. Canonical names can be obtained by using Active directory users and computers, goto the OU and select export. Copy the canonical names of the objects into a spreadsheet.

The properties to update should be placed after column A. Check below on how to find out the name of the properties of an user object.

Python 3.5.4 (v3.5.4:3f56838, Aug  8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyad import aduser
>>> u = 'Patrick B Kind, Shanghai'
>>> user = aduser.ADUser.from_cn(u)
>>> att = user.get_allowed_attributes()
>>> att.sort()
>>> for a in att:
...    print(a)
...
USNIntersite
aCSPolicyName
accountExpires
accountNameHistory
adminCount
adminDescription
adminDisplayName
allowedAttributes
allowedAttributesEffective
allowedChildClasses
allowedChildClassesEffective
altRecipient
altRecipientBL
altSecurityIdentities
assistant
attributeCertificate
attributeCertificateAttribute
audio

update_ad's People

Contributors

plj611 avatar

Watchers

James Cloos 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.