Active Directory - List object path |
Declaration
<AMACTIVEDIRECTORY ACTIVITY="list_object_path" AUTHTYPE="text (options)" USERNAME="text" PASSWORD="text (encrypted)" LDAPPATH="text" ADOBJECT="text (options)" FILTER="text" RESULTDATASET="text" />
Description
Retrieves a list of the paths for all Active Directory objects (i.e. computers, users, groups, etc.) at and below the specified path and populates a dataset with resulting values. Results can be filtered by object type and/or a filter string.
Practical Usage
Can be used along with other Active Directory activities to create a report with essential information on Active Directory infrastructure and objects. Reports can be created for management, distribution and/or auditing purposes.
Parameters
Object
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Get Active Directory using | Text (options) | No | Simple Filter | ACTION="CUSTOMFILTER" | The
manner in which to retrieve the Active Directory object's LDAP
(Lightweight Directory Access Protocol) paths. The available options
are:
|
Parent path | Text | Yes | (Empty) | LDAPPATH="LDAP:// DC=networkautomation,DC=com" |
The
LDAP path of the parent Active Directory object. Usually the top
most container or rootdse path. Click the Select Container button to select the parent container from the domain. When doing so, this launches a standard Windows Active Directory dialog box that allows for selection of the container. NOTE: The Parent
Path parameter is available only if Simple
Filter or Custom Filter
is selected from the Get Active
Directory Using parameter. |
Object | Text (options) | No | User | ADOBJECT="GROUP | The
type of object in which to retrieve its path from. The available
options are:
|
Filter | Text | Yes | (Empty) | FILTER="R*" | Provides the filter string to search for specific Active Directory objects. |
Custom filter | Text | Yes | (Empty) | CUSTOMFILTER="(&(objectCategory=user)(name=*))" | Allows entry of a custom filter string. This parameter is available only if the Get Active Directory using parameter is set to Custom Filter. |
Query statement (SQL or LDAP syntax) | Text | Yes | (Empty) | QUERY="SELECT ADs Path FROM 'LDAP://helpsystems.com' WHERE objectCategory='organizationalUnit'" | Allows entry of a SQL or LDAP ADO query string. This parameter is available only if the Get Active Directory Using parameter is set to ADO Query (SQL or LDAP syntax). |
Create and populate dataset with paths | Text | Yes | (Empty) | RESULTDATASET="ADObjects" | The name of a dataset in which to create and populate with the results. For more details, see Datasets below. |
Credentials
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Authentication type | Text (options) | No | Default |
|
Specifies
the types of authentication used. The available options are:
|
Username | Text | No | (Empty) | USERNAME="username" | The
username context that this activity will execute under. Leave
the Username and Password parameters blank in
order to use the logon user's credentials NOTE: A Domain User has
permission to access Active Directory information. However, only
a Domain Administrator has permission to perform Active Directory
modifications. |
Password | Text | No | (Empty) | PASSWORD="password" | The password associated to the Username context that this activity will execute under. Leave the Username and Password parameters blank in order to use the logon user's credentials. |
Additional Notes
Datasets
A dataset is a multiple column, multiple row container object. This action creates and populates a dataset with the following fields (assuming the dataset name entered was theDataset):
Name | Type | Return Value |
---|---|---|
theDataset.ClassName | Text | The class name. |
theDataset.Guid | Text | The GUID of the Directory Entry. |
theDataset.Name | Text | The name of the object as named with the underlying directory service. |
theDataset.NativeGuid | Text | The GUID of the Directory Entry, as returned from the provider. |
theDataset.Path | Text | The path for this directory entry. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
List all Active Directory object paths and populate dataset "ADObjects" with the results.
<AMACTIVEDIRECTORY ACTIVITY="list_object_path" AUTHTYPE="Secure" USERNAME="Administrator" PASSWORD="AM54nZlor7IjQk55PWC/Hh3Fx3/FJY61X2ulq0ptqRCrmQ=aME" QUERYTYPE="customfilter" LDAPPATH="LDAP://servername.com" CUSTOMFILTER="(&; (objectCategory=user) (name=*) )" RESULTDATASET="ADObjects" />