Skip to content

Instantly share code, notes, and snippets.

@poizan42
Created March 16, 2015 09:25
Show Gist options
  • Save poizan42/0664f2401c551f8c6032 to your computer and use it in GitHub Desktop.
Save poizan42/0664f2401c551f8c6032 to your computer and use it in GitHub Desktop.
Get all AD group members (> 1500)
$listObj = [ADSI]"LDAP://CN=DistList,CN=Users,DC=example,DC=com"
$tmpMembers = $listObj.PSBase.Invoke('Members') | %{([System.DirectoryServices.DirectoryEntry] $_).mail}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment