Skip to content

Instantly share code, notes, and snippets.

@irwins
Created January 22, 2016 05:32
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 irwins/095197559d6fec07f7ea to your computer and use it in GitHub Desktop.
Save irwins/095197559d6fec07f7ea to your computer and use it in GitHub Desktop.
<#
Author: I.C.A. Strachan
Version:
Version History:
Purpose: Get User nested group membership report
#>
[CmdletBinding()]
param(
[string]
$Identity
)
Get-ADUser -Identity $Identity |
ForEach-Object {
$ldapFilter = '(member:1.2.840.113556.1.4.1941:={0})' -f $_.DistinguishedName
Get-ADGroup -LDAPFilter $ldapFilter |
Select-Object SamAccountName,DistinguishedName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment