Establishes a connection to an Active Directory domain controller.


void Connect(string server, string username, string password)


Specify the following parameters when using this method.

Parameter Description


The name of the Active Directory domain controller to which you are establishing a connection.


The Active Directory user account for connecting to the domain controller. The rights associated with this account used to establish the connection to Active Directory can control the operations you are allowed to perform in a script.


The password for the Active Directory user account connecting to the domain controller.


This method enables you to connect to a specific domain controller using a specific user name and password, if the Active Directory server name, user name, and user password are all valid. This method is not required when you connect to Active Directory using the credentials you used to log on to the computer.

Call Cims.Connect("domaincontroller", NULL, NULL) to use the default user account


The following code sample illustrates using this method in a script:

'Specify credentials to use for connecting to Active Directory
cims.Connect(“”, “dane”, “Niles9!”);