Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows » LDAP: What is Lightweight Directory Access Protocol
  • WinServer
    Log Off: How to sign out of Windows Server 2012 Windows Server
  • gfhj
    Debugging: How to debug a PowerShell script Windows
  • Startup delay mbam
    Force immediate MBAM Encryption: Why does the MBAM Agent delay most times in encrypting devices? Windows
  • Building VPC
    Build a Scalable VPC for Your AWS Environment [Part 1] AWS/Azure/OpenShift
  • hero azure activedirectory
    How to add and verify a custom domain name to Azure Active Directory AWS/Azure/OpenShift
  • featureunions
    How to Install Unison on Linux System Linux
  • Veeam Enterprise Manager setup
    Veeam Enterprise Manager setup and User Role management Backup
  • any
    Install AnyDesk on Windows for remote Connections Windows

LDAP: What is Lightweight Directory Access Protocol

Posted on 06/02/201919/09/2023 Christian By Christian No Comments on LDAP: What is Lightweight Directory Access Protocol
LDAP

LDAP is a network protocol used to perform queries and changes in a distributed directory service. The protocol from the TCP / IP protocol stack is specified in the RFCs 4510, 4511, and 4532. LDAP itself is not a directory, but a protocol with which one can retrieve information from an LDAP directory. LDAP requires that all participating systems be able to exchange data on port 389 for unsecured transmission and port 636 for secure connection (TLS). The idea behind LDAP is simple: A directory in a tree structure distributed over different servers should be searchable. See the video below for a more high-level overview. Here is a guide on generating a self-signed SSL certificate: How to enable LDAP over SSL with a self-signed certificate.

The tree structure of the directory is broadly defined. The origin is the "root directory" and this branches into various groups such as organisations, organisational units and individuals etc. 

What is Lightweight Directory Access Protocol

Note: The latter may be users, persons, printers, scanners, computers, or servers, as the case may be. Although the system allows a high degree of flexibility in mapping structures, the definition of the elements in the schema is rather strict. Here are some use cases for LDAP.

  • User administration
  • System Administration
  • Protocol
  • NIS information
  • Boot information
  • File system mount point management
  • Organisation of alias names in e-mail systems
  • Administration of DNS zone data
  • Organisation of DHCP servers

LDAP implementation in Active Directory

LDAP is widely implemented in Microsoft Active Directory (AD) and it is the fourth major component of Active Directory. Other components are Kerberos, CIFS, and DNS. In the Active Directory environment, the LDAP directory provides information about users, computers, and their group membership. But other objects, such as computer certificates, are stored in the directory.

LDAP basic structure is simple. LDAP consists of objects and follows largely the approach of object-oriented programming with classes, inheritance, polymorphism, and the objects themselves. A directory service entry consists of a list of attributes and a “mandatory object” – the name of the object itself, the “Distinguished Name”.

This name is similar to a filename and shares the same property with the filename convention: it is not possible to have the same name in the same level. Objects named “OU” represent containers in which other objects can be created. Here are some attributes used with LDAP.

CN: commonName 
L: localityName
ST: stateOrProvinceName
O: organisationName
OU: organisationalUnitName
C: countryName
STREET: streetAddress
DC: domainComponent
UID: userid

At first glance, this seems to be rather ambiguous, confusing, and complex. Let’s go into details and try to make sense of these attributes.

Let’s say an Active Directory is named techdirectarchive.local and a new user with the name “Martin, brown” is created while the selection on the root directory techdirectarchive.local is created. Here is how the attribute would look like.

CN = Martin brown, DC =  techdirectarchive, DC = local

Now the object is moved to an Organisation Unit (OU) with the title “persons” and the DN is looked at again:

CN = Martin brown, OU = persons, DC = techdirectarchive, DC = local

Within the OU people, another OU for better grouping of users due to job roles. This should be called “Accounting Employees” and the user object of Martin brown is assigned to this new OU. Thus, the DN is:

CN = Martin brown, OU = Accounting Employees, OU = persons, DC = techdirectarchive, DC = local

Now the logic is almost automatic. The commonName , the name of the object itself, is on the left side, while the assignment from the right side starts with the domain structure local , followed by techdirectarchive.

What is Lightweight Directory Access Protocol

Conveniently, there are a large number of programs that can query a directory structure using LDAP; For Microsoft Windows, for example, the “LDAP Admin” by T. Karlovic is a compact and practical solution. On the other hand, there are many script variants to determine information via LDAP. Below is the PowerShell script:

$ strFilter = "(& (objectCategory = User))" 
$ objDomain = New-Object System.DirectoryServices.DirectoryEntry 
$ objSearcher = New-Object System.DirectoryServices.DirectorySearcher 
$ objSearcher.SearchRoot = $ objDomain 
$ objSearcher. PageSize = 1000 
$ objSearcher.Filter = $ strFilter 
$ objSearcher.SearchScope = "Subtree" 
$ colProplist = "name" 
foreach ($ i in $ colPropList) {$ objSearcher.PropertiesToLoad.Add ($ i)} 
$ colResults = $ objSearcher. FindAll () 
foreach ($ objResult in $ colResults) 
  {$ objItem = $ objResult.Properties; $ objItem.name}

It returns the usernames of the employees from the department (see first line department = editorial ). If the script is looking for something else, for example, employees whose login names contain a special sequence of letters, the first line looks something like this:

$ strFilter = "(& (objectCategory = User) (sAMAccountName = Me *))"

The asterisk behind “Me” acts as a wildcard here. The lower part of this PS command sequence (from the Microsoft homepage) can therefore be used quite well for other purposes. But, it’s also much, much easier – with a one-liner in the PowerShell:

Get-ADUser filter {Name -Like "*"} -Searchbase "OU = PEOPLE, DC = techdirectarchive, DC = local"

For example, if the administrator wants to read out the phone numbers, this one command will expand a bit:

Get-ADUser -filter {Surname -Like "*"} -properties cn, telephoneNumber -SearchScope Subtree-SearchBase "OU = People, DC = techdirectarchive, DC = local" | select-object Surname, Givenname, telephoneNumber

Furthermore, Surname is the surname here, while the Given name represents the first name. However, See the following link for more information on LDAP. I hope you found this blog post helpful. Moreover, Please let me know in the comment session if you have any questions.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Windows Tags:LDAP, Windows 10, Windows Subsystem for Linux

Post navigation

Previous Post: What is SAML – Security Assertion Markup Language
Next Post: Active Directory Administrative Tools shortcut

Related Posts

  • Uninstall Wampserver
    How to uninstall WAMPServer from Windows Web Server
  • Feature image   Hiren's boot
    Recover your data after system failure with Hiren’s boot Backup
  • How to fix CPU at 100 when nothing is running problem on Windows
    How to fix CPU at 100% when nothing is running problem on Windows Windows
  • Norton RDP
    Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
  • Header picture 1
    Find BIOS Serial Number and System Information on Windows 11 Windows
  • Fixing TPM Vulnerability
    How to fix a vulnerable Trusted Platform Module [TPM] Windows

More Related Articles

Uninstall Wampserver How to uninstall WAMPServer from Windows Web Server
Feature image   Hiren's boot Recover your data after system failure with Hiren’s boot Backup
How to fix CPU at 100 when nothing is running problem on Windows How to fix CPU at 100% when nothing is running problem on Windows Windows
Norton RDP Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
Header picture 1 Find BIOS Serial Number and System Information on Windows 11 Windows
Fixing TPM Vulnerability How to fix a vulnerable Trusted Platform Module [TPM] Windows

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • WinServer
    Log Off: How to sign out of Windows Server 2012 Windows Server
  • gfhj
    Debugging: How to debug a PowerShell script Windows
  • Startup delay mbam
    Force immediate MBAM Encryption: Why does the MBAM Agent delay most times in encrypting devices? Windows
  • Building VPC
    Build a Scalable VPC for Your AWS Environment [Part 1] AWS/Azure/OpenShift
  • hero azure activedirectory
    How to add and verify a custom domain name to Azure Active Directory AWS/Azure/OpenShift
  • featureunions
    How to Install Unison on Linux System Linux
  • Veeam Enterprise Manager setup
    Veeam Enterprise Manager setup and User Role management Backup
  • any
    Install AnyDesk on Windows for remote Connections Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.