Skip to content

Instantly share code, notes, and snippets.

@iainelder
Last active December 25, 2015 05:09
Show Gist options
  • Save iainelder/6922600 to your computer and use it in GitHub Desktop.
Save iainelder/6922600 to your computer and use it in GitHub Desktop.
Output as a table all the active directory groups I am a member of. Is there a more elegant way to turn a list into a column?
@('iain', 'admin_iain') |
% {
$id = $_
(Get-ADPrincipalGroupMembership -Identity $id | Select -ExpandProperty name) |
% {
@{ $id = $_ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment