pyad

A suitable Pythonic interface to communicate with Active Directory through ADSI on the Windows platform is provided by the pyad Python package. The library makes Active Directory-related operations easier by offering classes for a variety of objects, including users and groups. Within the Active Directory context, it enables the creation, deletion, and searching of objects.

pyad is a Python library developed to provide a user-friendly and Pythonic interface for interacting with Active Directory using ADSI on the Windows platform. This library simplifies tasks related to Active Directory by offering classes for various objects such as users and groups. It enables object manipulation, creation, deletion, and searching within the Active Directory environment, making it a convenient tool for developers and administrators working with Windows-based Active Directory systems.

Installation

 

How to Use

Connecting to Active Directory:

By default, pyad connects to the Active Directory domain towhich the machine is joined (rootDSE):

  

It's possible to connect to a specific domain controller oruse alternate credentials:

 

You can also pass in options when connecting to a specificobject:

Basic Object Manipulation:

There are Python classes for different Active Directoryobjects. For example, ADUser represents user objects, and ADGroup representsgroups. Objects can be manipulated using various methods:

Direct manipulation of attributes is also possible:

Creating, Moving, and Deleting Objects:

Objects can be created, moved, and deleted. For example:

Objects can be moved:

Or renamed:

Objects can be removed:

Objects can be searched using the ADQuery interface:

Additional Information

License:

pyad is licensed under the Apache License,Version 2.0. You can obtain a copy of the license here.

Documentation and Code:

Complete documentation can be found at pyad Documentation, and the code is maintained on GitHub.

Download:

The library can be downloaded from PyPI.

Table of Contents: