If - Object exists |
Declaration
<AMIF ACTIVITY="adobjectexist" AUTHTYPE="FastBind" USERNAME="text" LDAPPATH="text" ADOBJECT="text (options)" OBJECTNAME="text" PASSWORD="text (encrypted)" />
Description
Allows task execution to continue to the next step if the Active Directory object at the specified path exists. Otherwise, task execution flows to the next Else or End If step.
Practical Usage
Ideally used as a conditional step to perform specific actions depending on whether an Active Directory object exists. For instance, if object exists, execute the Active Directory - Move object activity to move the object to a new location or execute the Active Directory - Delete object activity to delete the object.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Parent LDAP path | Text | Yes | (Empty) | LDAPPATH="LDAP://DC=netauto,DC=com" | The Lightweight Directory Access Protocol (LDAP) path of the parent Active Directory container. This is usually the top most container or rootDSE path, the root of the directory data tree on a directory server. Click the Select Container button to launch a standard Windows dialog box that allows for the selection an Active Directory container. |
Type | Text (options) | Yes | User |
| The
type of Active Directory object to search for. The available options
are:
|
Name | Text | Yes | (Empty) | OBJECTNAME="printer" | The name of the Active Directory object to search for. This parameter accepts wildcard characters (that is, * or ?). For example, entering S* will return objects whose names start with "S" in the active directory. |
Credentials
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Authentication type | Text (options) | Yes | Default |
| The
Active Directory authentication mechanism to use. The available
options are:
|
Username | Text | Yes | User | USERNAME="ADUser" | Specifies
the username of the Active Directory user.
NOTE: Leave the Username
and Password fields
blank in order to use the logon user's credentials. If only accessing
Active Directory information, then any Domain user is valid. However,
a Domain Administrator is required in order to modify an Active
Directory user or group. We recommend using the credentials of
a Domain Administrator for all Automate Active Directory actions. |
Password | Text | Yes | (Empty) | PASSWORD="encrypted" | Specifies
the password of the Active Directory user. NOTE: Leave the Username
and Password fields
blank in order to use the logon user's credentials. If only accessing
Active Directory information, then any Domain user is valid. However,
a Domain Administrator is required in order to modify an Active
Directory user or group. We recommend using the credentials of
a Domain Administrator for all AutoMate Active Directory actions. |
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
Determines if an Active Directory computer object named "computerUsers" exists. If the object exists, rename it to "AutomateUsers." If the object does not exist, create a new computer object named "AutomateUsers."
<AMIF ACTIVITY="adobjectexist" LDAPPATH="LDAP://servtest.com/OU=TestUsers,DC=servtest,DC=com" ADOBJECT="computer" OBJECTNAME="computerUsers" />
<AMACTIVEDIRECTORY ACTIVITY="rename_object" LDAPPATH="LDAP://servtest.com/OU=TestUsers,DC=servtest,DC=com" OBJECTNAME="AutomateUsers" /><AMELSE />
<AMACTIVEDIRECTORY ACTIVITY="create_object" LDAPPATH="LDAP://servtest.com/OU=TestUsers,DC=servtest,DC=com" OBJECTNAME="AutomateUsers" /></AMIF>