Within every Active Directory (AD) domain, several special containers serve as the default location for certain types of objects. This feature is useful because it permits applications to default to a particular container if you don't specify a container when creating or searching for that type of object. You're probably familiar with some of these containersfor example, the cn=Computers container is for computer objects, and the cn=Users container is for user and group objects.
You can use VBScript to bind to the cn=Computers container:
Set objComputers = GetObject _
("LDAP://cn=Computers," & _
"dc=rallencorp,dc=com")
This line of code works fine, unless you want to use an organizational unit (OU) to store computer objects. In that case, this code doesn't work. To address this problem, Microsoft supports (in Windows Server 2003 and Windows 2000) another type of binding in AD called a Well-Known GUID (WKGUID) binding. Instead of specifying cn=Computers, you can use a GUID that maps to that container. For example, the WKGUID of the default cn=Computers container is aa312825768811d1aded00c04fd8d5cd. To make your GetObject call resilient to such name changes, you can use the following line of code:
Set objComputers = GetObject _
("LDAP://<WKGUID=aa31282" & _
"5768811d1aded00c04fd8d5cd," & _
"dc=rallencorp,dc=com>")
The only differences are that the container name is replaced with WKGUID=aa312825768811d1aded00c04fd8d5cd and the full path of the object is surrounded by caret brackets. Let's take a look at how to use WKGUID binding and how to change the default WKBIND containers in Windows 2003. . . .