SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL
SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL

Many ways to query AD users

There are multiple good PowerShell options to query an Active Directory user object.   Below are three code snippets which all locate an AD user.   Cheers!

 

Option 1- Get-ADUser Login

 

Option 2- Get-ADUser Filter

 

Option 3 – LDAP Directory Searcher

 

Option 4 – DSA.MSC

  1. Open Active Directory Users and Computers.
  2. Right-click the domain object and select Find.
IC125695
  1. Active Directory Users and Computers Select Find
  2. Click the drop-down list next to Find, and then select Custom Search.
IC25246
  1. From the next screen, select the Advanced tab.
  2. Type the appropriate LDAP statement under Enter LDAP query.

 

Option 5 – LDP.EXE

  1. Download from https://www.microsoft.com/en-us/download/details.aspx?id=15326
  2. On the Browse menu, click Search.
  3. The Search dialog box opens.
  4. To search for all users that have a first name of John and a last name of either Smith or Jones, type the following in the Filter field:
  5. (&(objectClass=user)(givenName=John)(|(sn=Smith)(sn=Jones))))
Image result for ldp.exe

 

 

References

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲