List All Group Memberships of Current User

by May 14, 2009

In case you need to get a list of all of your current Group memberships as derived from your current access token, use this line:

([System.Security.Principal.WindowsIdentity]::GetCurrent()).Groups |
Foreach-Object { $_.Translate([System.Security.Principal.NTAccount])}

The result is a list of Group names that reflect current members, which accurately reflects the Group memberships as they are defined in your current access token that you received at last log-on.