Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active June 17, 2020 20:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/6df2798cb54042993dfb47d905060b5f to your computer and use it in GitHub Desktop.
Save darrenjrobinson/6df2798cb54042993dfb47d905060b5f to your computer and use it in GitHub Desktop.
$Server = "LDAP://servername:389/O=Customer-Aus"
$Username = "CN=Darren Kloud Robinson,OU=OrgU,O=Org-Aus"
$Password = "******"
$entry = New-Object System.DirectoryServices.DirectoryEntry($Server,$Username,$Password,"none")
$LDAPfilter = "(objectclass=*)"
$directorySearcher = New-Object System.DirectoryServices.DirectorySearcher($entry,$LDAPfilter)
$results = $directorySearcher.FindAll()
$results.Count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment