LDAP Binding Strings (2024)

Binding to Active Directory objects with the LDAP provider

To access the properties and methods of an object, you need to bind to it. This creates a reference to the object. You bind to Active Directory objects in VBScript with a "Set" statement, using the GetObject method. GetObject requires a "binding string", which is a text string that uniquely specifies the object in Active Directory. This is also referred to as the ADsPath of the object. Below are examples of statements that bind to objects with the LDAP provider. The binding string is the string in quotes.

Set objUser = GetObject("LDAP://cn=Joe Smith,ou=East,dc=MyDomain,dc=com")
Set objComputer = GetObject("LDAP://cn=Test2,cn=Users,dc=MyDomain,dc=com")
Set objGroup = GetObject("LDAP://cn=Engr,ou=East,dc=MyDomain,dc=net")
Set objOU = GetObject("LDAP://ou=Sales,ou=East,dc=MyDomain,dc=MyFirm,dc=com")

where:

LDAP:The provider (case sensitive)
objUser, objComputer, objGroup, objOU Variable referring to the object
cn=Joe Smith,ou=East,dc=MyDomain,dc=net Distinguished Name of user "Joe Smith"
cn=Joe Smith Relative Distinguished Name of user "Joe Smith"
dc=MyDomain,dc=com DNS domain name (MyDomain.com)
cn=Users Relative Distinguished Name of container "Users"
ou=East Organizational Unit where user "Joe Smith" resides
cn Common Name
ou Organizational Unit
dc Domain Component

The AdsPath of an object in Active Directory (the binding string) consists of the provider moniker (LDAP://) appended to the Distinguished Name of the object. The Distinguished Name specifies not just the name of the object, but also its location in the Active Directory hierarchy. The Distinguished Name consists of a series of components separated by commas. Each component consists of a moniker, an equals sign, and the name of the component. For example, the component "ou=Sales" is an organizational unit whose name is "Sales". The moniker "ou" means organizational unit. The component "cn=Test2" is an object whose Common Name is "Test2". The moniker "cn" means Common Name. Similarly, the moniker "dc" means domain component. The component "dc=MyDomain" is a domain component with the name "MyDomain".

As an example, the Distinguished Name "cn=Joe Smith,ou=East,dc=MyDomain,dc=com" has four components. The first (lowest level) component of the Distinguished Name is the Relative Distinguished Name (RDN) of the object. In this case, the RDN is "cn=Joe Smith". The RDN of an object is the name of the object in its container. The remainder of the components are the Distinguished Name of the container, which is the parent of the object. In this case, the object "cn=Joe Smith" is in the container whose Distinguished Name is "ou=East,dc=MyDomain,dc=com". In this case, the parent container is an organizational unit. The parent of the "ou=East" organizational unit is the domain "MyDomain.com". This domain has domain components "dc=MyDomain" and "dc=com". The full DNS name of the domain is "dc=MyDomain,dc=com".

Container objects can be containers, organizational units, or domains. Container objects are objects that can "contain" other objects, such as user objects, group objects, and computer objects. Group objects are not containers. Groups can have members, but the members are not children of the group object.

In some cases it might be necessary to include a server name in the LDAP binding string. Usually, this is to refer to the copy of the object on a particular Domain Controller. However, it sometimes is necessary on NT or Win9x clients where DSClient has not been installed. In the example above, we bind to the copy of the "cn= Joe" object that is on the domain controller "MySvr".

Set objUser = GetObject("LDAP://MySvr/cn=Joe,cn=users,dc=MyDom,dc=com")

The server name can also be specified as a DNS host name. For example, the above could be:

Set objUser = GetObject("LDAP://MySvr.MyDom.com/cn=Joe,cn=users,dc=MyDom,dc=com")

The binding strings described so far have been in "Little-Endian" form. This is by far the most common. However, there is also a "Big-Endian" form, with elements in the binding string reversed and separated by slashes instead of commas:

Set objUser = GetObject("LDAP://MyDC/dc=com/dc=MyDom/OU=Sales/cn=Test3")

Different classes of objects in Active Directory use different monikers in their Relative Distinguished Names. This moniker is the attribute that names the object. The following table shows the naming attribute for common classes of objects in Active Directory.

Object ClassNaming attribute
usercn (Common Name)
groupcn (Common Name)
computercn (Common Name)
containercn (Common Name)
organizational unitou (Organizational Unit)
domaindc (Domain Component)

Send email to [email protected] with questions or comments about this web site.
Copyright © 2002-2021 Richard L. Mueller
Last modified November 11, 2021

LDAP Binding Strings (2024)
Top Articles
Celebrating 17 years of Git
Anthony Stark (Earth-616)
Xre-02022
Tattoo Shops Lansing Il
Pet For Sale Craigslist
Breaded Mushrooms
What to Do For Dog Upset Stomach
Pga Scores Cbs
Jesus Calling December 1 2022
Blairsville Online Yard Sale
Craigslist Mexico Cancun
Heska Ulite
Anki Fsrs
Watch TV shows online - JustWatch
Jesus Calling Oct 27
Dr. med. Uta Krieg-Oehme - Lesen Sie Erfahrungsberichte und vereinbaren Sie einen Termin
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Sound Of Freedom Showtimes Near Cinelux Almaden Cafe & Lounge
Kiddle Encyclopedia
Noaa Ilx
Pjs Obits
SuperPay.Me Review 2023 | Legitimate and user-friendly
Wemod Vampire Survivors
8005607994
Xfinity Cup Race Today
Directions To Cvs Pharmacy
Filthy Rich Boys (Rich Boys Of Burberry Prep #1) - C.M. Stunich [PDF] | Online Book Share
Obituaries Milwaukee Journal Sentinel
Sienna
Horses For Sale In Tn Craigslist
Movies - EPIC Theatres
Craftsman Yt3000 Oil Capacity
Solo Player Level 2K23
LG UN90 65" 4K Smart UHD TV - 65UN9000AUJ | LG CA
The Monitor Recent Obituaries: All Of The Monitor's Recent Obituaries
Moonrise Time Tonight Near Me
O'reilly's Wrens Georgia
Grandstand 13 Fenway
Xfinity Outage Map Lacey Wa
47 Orchid Varieties: Different Types of Orchids (With Pictures)
Craigslist Central Il
Amici Pizza Los Alamitos
Chattanooga Booking Report
Prima Healthcare Columbiana Ohio
Craigslist Boats Eugene Oregon
Live Delta Flight Status - FlightAware
Swoop Amazon S3
Trending mods at Kenshi Nexus
5103 Liberty Ave, North Bergen, NJ 07047 - MLS 240018284 - Coldwell Banker
A Man Called Otto Showtimes Near Cinemark Greeley Mall
Erespassrider Ual
Sunset On November 5 2023
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 6437

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.