Would you like to learn how to perform queries on an LDAP server using Powershell? In this tutorial, we are going to show you how to use Powershell to perform LDAP queries on the Active Directory using the command line.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 2022
• Windows 10
• Windows 11

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Related tutorial - PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell - Perform LDAP query on Active Directory

Start a Powershell command-line.

Start Powershell

Query the Active Directory server using LDAP and Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Configure the search root and perform the LDAP query.

Copy to Clipboard

There are multiple ways to configure the search root.

Copy to Clipboard

Apply filters to the LDAP query.

Copy to Clipboard

There are multiple ways to apply filters to the LDAP query.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Apply advanced filters to the LDAP query.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get the properties of an LDAP object using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get specific properties of an LDAP object using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Optionally, display the results as a list.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to perform LDAP queries on the Active Directory using Powershell.