Sometimes you have to ask for your own group membership or you write a script and have to get the memberships. Everybody knows the command whoami but does you know that you can convert it to CSV with PowerShell.

WHOAMI /GROUPS /FO CSV /NH | ConvertFrom-Csv -Header 'GroupName','Type','SID','Attributes'

Then you have a PowerShell object and you can make a filter, select or whatever.

Leave a Reply

Your email address will not be published.