Skip to content

Instantly share code, notes, and snippets.

@duffney
Created August 16, 2016 19:59
Show Gist options
  • Save duffney/444c3dbfadf915326f074fa1e274f9a9 to your computer and use it in GitHub Desktop.
Save duffney/444c3dbfadf915326f074fa1e274f9a9 to your computer and use it in GitHub Desktop.
function Get-ADGroupMemberProperties {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Identity,
[Parameter(Mandatory=$false)]
$Properties
)
begin {
$members = (Get-ADGroupMember -Identity $Identity).ObjectGUID
}
process {
foreach ($member in $members) {
$params = @{
'Identity' = $member
}
if ($PSBoundParameters.ContainsKey('Properties')){
$params.Add('Properties',$Properties)
}
Get-ADUser @params
}
}
end {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment