Search Knowledge Base by Keyword

PowerShell: Microsoft Active Directory

< Back

Overview

Active Directory is the on-premises directory service that underpins most Windows enterprise estates. It holds user accounts, computer accounts for domain-joined machines, security and distribution groups, and the organisational unit hierarchy that expresses how those objects are delegated and administered. It remains the authoritative identity source in the majority of organisations, including those that have also adopted cloud identity.

This connector reads Active Directory by running a PowerShell script, CX_LDAP.ps1, on a Windows host. The connection names the directory server and a port (the default is 3268, the global catalog port, which searches across the whole forest instead of a single domain), an optional organisational unit to scope the search to a subtree, and a temporary working path for the files the script produces during processing. Each job’s Data Selection field is a comma-separated list of directory attributes to retrieve, and the results are written to the named staging table.

In a ReadyWorks context this is the backbone of identity and endpoint reconciliation. Four jobs give you the people, the machines, the groups and the relationships between them, which is what lets the data fabric answer who owns a device, which groups gate an application, and which accounts and machines are stale enough to exclude from a migration wave.

Active Directory carries data that a cloud directory connector does not. Computer objects for domain-joined machines, with their operating system, version, service pack, last logon date, location and managed-by attributes, exist only here. So does the organisational unit and distinguished name hierarchy, which encodes site, region and delegation structure that has no cloud equivalent. So do on-premises group types such as domain-local and distribution groups, and account attributes such as home directory and primary group. If your estate runs both, run the cloud connector and this one, and reconcile on the account identifiers they share.

The connector is inbound only. It reads the directory and writes staging tables, and it makes no changes to any directory object.

NOTE: windows_only is set on this connector. The ReadyWorks ETL host that runs these jobs has to be a Windows machine with PowerShell and the Active Directory module available, and the account the ETL service runs under needs read access to the directory. A Linux-hosted ReadyWorks deployment cannot run this connector.

Connector Properties

Property Value
Identifier RWS_AD
Name Powershell: Microsoft Active Directory
Description Active Directory connector for Windows Only configurations.
Job Types Inbound Only
Order 800
Enabled Yes
Locked Yes
Block Update No
Single Authentication No
Windows Only Yes
Connector Version 2025-11-07
Hooks None
Additional Job Fields None
Image

Authentication Methods

One method ships. It is a Windows PowerShell connection to a directory server rather than a web API call.

Method Identifier Base Method Script Order Enabled Config Fields
Microsoft Active Directory RWS_AD_000a62482f RWS_AD_000a62482f CX_LDAP.ps1 10 Yes 4

NOTE: There is no credential field on this connection. Access is governed entirely by the Windows account the ReadyWorks ETL service runs as, so that account is what a security review needs to see.

NOTE: Port 3268 returns only attributes that are replicated to the global catalog. If an attribute you listed in Data Selection comes back consistently empty, check whether it is in the global catalog partial attribute set before assuming the directory does not hold it.

Method 1: Microsoft Active Directory (RWS_AD_000a62482f)

Active Directory Connection using Windows Powershell Script

Microsoft Active Directory runs CX_LDAP.ps1 against the server named in Source Server on the port in Source Server Port. The default port 3268 is the global catalog, which returns a partial attribute set across every domain in the forest; use 389 when you need the full attribute set from a single domain. Organizational Unit optionally scopes the search to one subtree, which is the main lever for keeping run times and row counts manageable on a large forest. No username or password fields are presented, so the script authenticates as the Windows identity the ETL process runs under.

Connection Configuration Fields (4)

Order Label Type Required Default Max Len Tooltip
10 Source Server text Yes 255 Enter Source Server of the Connection
20 Source Server Port text Yes 3268 5 Enter port number of the source server
30 Organizational Unit text No 255 Enter Organizational Unit of the connection.
40 Server Temporary Working Path text Yes storage/etl5 255 Enter path where temporary files are stored during data processing (exclude starting and ending backslash)

Authentication Configuration

cURL options:

Option Authentication Call Data Calls
USERAGENT Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Same
SSL_VERIFYHOST false Same
SSL_VERIFYPEER false Same
RETURNTRANSFER true Same
FOLLOWLOCATION true Same
FAILONERROR true Same

Inbound Job Fields Enabled (11)

These are the job-level settings exposed for an Active Directory extract. Data Selection holds the attribute list and Request Filter narrows which objects are returned.

Order Label Type Required Default Tooltip
10 Job Description text Yes Enter description of the Job
20 Job Schedule lookup Yes Daily Select frequency Job should run
30 Enabled radio Yes Yes Choose if Job is enabled
70 Destination Table text Yes Enter name of the destination table
80 Data Identity text No Enter identity of the Job
90 Data Selection textarea No Enter connector specific data selection command of the Job
130 Fields to Index text No Enter fields to index
140 Request Filter textarea No Enter fields to filter from the Job
160 Request Additional Sort Field(s) text No Enter any additional fields to sort by
230 Pate Processing text No
560 Order text Yes Enter order of the Job

Inbound Job Templates (4)

Four inbound templates ship, covering users, computers, groups and group membership. All four are enabled by default and run daily, so they begin returning data as soon as a connection exists.

# Job Description Destination Table API End Point Enabled What It Pulls
1 AD User Data ad_user Not set Yes Every user account in scope, into ad_user. The attribute list covers identity (SamAccountName, UserPrincipalName, ObjectGUID, DisplayName, GivenName, Surname), organisational placement (CanonicalName, DistinguishedName, Department, Division, Company, Title, Manager, EmployeeID, EmployeeNumber), contact and location data (mail, OfficePhone, HomePhone, City, State, StreetAddress, PostalCode, POBox, country, physicalDeliveryOfficeName), and account lifecycle signals (Enabled, LastLogonDate, logoncount, PasswordLastSet, AccountExpirationDate, whencreated, whenchanged).
2 AD Computer Data ad_computer Not set Yes Every domain-joined computer account in scope, into ad_computer. Returns the machine name and canonical and distinguished names, its enabled state, OperatingSystem with version and service pack, LastLogonDate, plus the location, managedBy, description, PrimaryGroup and whencreated attributes. This is the join key between the directory and endpoint management data.
3 AD Group Data ad_group Not set Yes Every group in scope, into ad_group. Returns samAccountName, CanonicalName, DistinguishedName, ObjectGUID, grouptype (which distinguishes security from distribution groups and global from domain-local scope), description, mail, managedby and the created and changed timestamps.
4 AD Group Nembership Relationship ad_groupmembers Not set Yes The membership edges, into ad_groupmembers. For each object it returns ObjectGUID, samAccountName and the MemberOf list, so the table is read as one row per principal with the groups it belongs to. Joined to ad_group this reconstructs the group graph.

Job Template Configuration

Settings Common to All Four Templates

Setting Value
Enabled Yes
Job Schedule Daily (15 1 * * *)
Allow Empty Table Yes
Append Files to Same Destination Table No
Append New Data to Existing Tables No
Use Unparsed Data No
Convert UUID-Keyed Objects to Rows No
Ignore XML Attributes No
Log Raw API Calls No
Method Type GET
Body Data Sending Method JSON Encoded Data
request_sortby CanonicalName

Settings That Vary by Template

Template ID Order Destination Table Data Identity Fields to Index
AD User Data 250 10 ad_user ad_user CanonicalName,DisplayName,DistinguishedName,Enabled, SamAccountName,ObjectGUID
AD Computer Data 251 20 ad_computer ad_computer enabled, Name
AD Group Data 252 30 ad_group ad_group distinguishedname,objectguid,samAccountName
AD Group Nembership Relationship 253 40 ad_groupmembers ad_groupmembers ObjectGUID,samAccountName

Job Parameters and Enumeration

AD User Data

Data Selection:

AccountExpirationDate,CanonicalName,City,Company,country,Department,departmentnumber,Description,DisplayName,DistinguishedName,Division,EmployeeID,EmployeeNumber,Enabled,GivenName,HomeDirectory,HomePhone,LastLogonDate,logoncount,mail,Manager,ObjectGUID,OfficePhone,PasswordLastSet,physicalDeliveryOfficeName,POBox,PostalCode,SamAccountName,State,StreetAddress,Surname,Title,UserPrincipalName,whenchanged,whencreated

AD Computer Data

Data Selection: cn,description,distinguishedname,enabled,lastlogondate,location,managedby,Name,objectguid,OperatingSystem,operatingsystemservicepack,operatingsystemversion,PrimaryGroup,whencreated

AD Group Data

Data Selection: CanonicalName,description,distinguishedname,grouptype,mail,managedby,objectguid,samAccountName,whenchanged,whencreated

AD Group Nembership Relationship

Data Selection: MemberOf,ObjectGUID,samAccountName

NOTE: All four jobs read the same directory on the same daily schedule. On a large forest, stagger them or scope them with the Organizational Unit field on the connection so that they do not run concurrently against the same directory servers.

Outbound Job Templates (0)

This connector ships no outbound templates and does not support outbound jobs.