LDAP: how-to bind to Active Directory
When using scripts and Active Directory, there are several ways to connect to a domain or forest:
- GC://tools4ever.local
Connects to the global catalog of the domain, relying on DNS records to locate the GC. - LDAP://tools4ever.local
Uses LDAP to connect to the domain. To see which domain controller you will actually connect to, execute “SET LOGONSERVER” on your prompt. This is the domain controller which was used to authenticate your logon request and was appointed to handle this request using AD Sites & Services based on your computer’s IP subnet. - LDAP://tools4ever.local/OU=accounts,DC=tools4ever,DC=local
Binds directly to a specific OU, used to set a scope for queries. - LDAP://dc01.tools4ever.local
connects directly to a domain controller