
Once the connection is established, the list of groups the user is a member of is retrieved by using the user's memberOf attribute. It uses the ADSI IADsADSystemInfo object to obtain the current user's distinguished name, which in turn is used to connect to the corresponding user object in Active Directory. It maps the H: drive to the home directory of the user by calling the WSH Network object's MapNetworkDrive method in combination with the WSH Network object's UserName property. Service Interfaces (ADSI) to perform three common tasks based on a user's group membership:.The following example logon script contains VBScript commands that use Active Directory.Collecting computer system information.Installing and setting a user's default printer.Some tasks commonly performed by logon scripts include: You can use a text editor to create logon scripts. The Windows Server 2003 family supports two scripting environments: the command processor runs files containing batch language commands, and Windows Script Host (WSH) runs files containing Microsoft Visual Basic Scripting Edition (VBScript) or Jscript commands.

The scripts can carry out operating system commands, set system environment variables, and call other scripts or executable programs. You can use logon scripts to assign tasks that will be performed when a user logs on to a particular computer.

