Platform SDK: Active Directory, ADSI, and Directory Services |
The WinNT provider's binding string has the following format:
WinNT:[//DomainName[/ComputerName[/ObjectName[,className]]]]
or
WinNT:[//DomainName[/ObjectName[,className]]] WinNT:[//ComputerName,computer]
Note [ ] denotes optional parameters; it is not a literal part of the binding string.
If you supply WinNT:
as a binding string, ADSI will enumerate all domains in the enterprise.
You can narrow binding to a specific domain by adding the domain name as part of the binding string. If you would like to communicate with a specific server, you can append a server name in front of a domain name. Optionally, you can directly specify the computer name without specifying a domain name. For example, WinNT://mymachine,computer
. If the computer you bind to is not a domain controller, the provider will bind to the local machine account.
In addition to a computer name, an object name may be part of a binding string. For example, user, group, printer and service objects can all be part of a binding string. Since Windows 2000 allows you to name objects with the same name as long as they are not in the same class, you should avoid the ambiguity by including a class name.
The following table shows examples of some ADsPaths.
ADsPath | Meaning |
---|---|
WinNT: |
Bind to the root of the namespace. |
WinNT://MyDomain |
Bind to the root of the MyDomain domain. |
WinNT://MyDomain/bob,user |
Bind to user MyDomain\bob. |
WinNT://MyDomain/dc01/MyGroup, group |
Bind to a group on the dc01 domain controller. |
WinNT://Server01,computer |
Bind to the Server01 computer. |