Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
Using rootDSE involves three basic steps.
Steps 2 and 3 are often combined to reduce the length of the script.
The goal of the four scripts in this section is to demonstrate how to use rootDSE to bind to the current domain, the root domain, the configuration container, and the schema container. Using rootDSE to form an ADsPath to the current domain, the root domain, and the configuration container is useful for the previous script examples in this chapter. Using rootDSE to form an ADsPath to the schema container is useful for the scripts appearing in the upcoming section "Active Directory Architecture."
The script in Listing 5.42 binds to the current domain by using the defaultNamingContext attribute of rootDSE. The current domain is the domain where the client is logged on. This example is particularly useful for the numerous listings in this chapter that access the current domain. By modifying the binding string, you can also use this example for binding to a common container such as the Users container, an OU, or any leaf object in the domain. To carry out this task, the script performs the following steps:
Listing 5.42 Constructing an ADsPath to the Current Domain with rootDSE
|
|
In the na.fabrikam.com domain, the strADsPath variable contains:
LDAP://DC=na,DC=fabrikam,DC=com
The script in Listing 5.43 binds to the root domain. Regardless of which domain the client is logged on to, the root domain in the forest is returned.
Listing 5.43 Constructing an ADsPath to the Root Domain with rootDSE
|
|
In any domain in the fabrikam.com forest, the strADsPath variable contains:
LDAP://DC=fabrikam,DC=com
The script in Listing 5.44 binds to the configuration container in the forest.
Listing 5.44 Constructing an ADsPath to the Configuration Container with rootDSE
|
|
In any domain in the fabrikam.com forest, the strADsPath variable contains:
LDAP://CN=Configuration,DC=fabrikam,DC=com
The script in Listing 5.45 binds to the schema container in the forest.
Listing 5.45 Constructing an ADsPath to the Schema Container with rootDSE
|
|
In any domain in the fabrikam.com forest, the strADsPath variable contains:
LDAP://CN=Schema,CN=Configuration,DC=fabrikam,DC=com
Note
Send us your feedback | « Previous | Next » |