SOLVED: Easy Way To Export a List What Groups You Are A Member Into a Text File

Sometimes you may find that you need to export the list of which security and distribution groups a user belongs to into a text file. This is sometimes done for auditing purposes and sometimes required because that amount of text in a CMD prompt is just oo hard to navigate.

As you can see in the screenshot above, we are using the whoami command, but you can also use net user as we explain here.

  • whoami returns the current username
  • whoami /groups returns a complete list of all groups that user belongs to
  • whoami /groups > c:\temp\test1.txt creates a file that contains all of the groups the user belongs to

Published by
Ian Matthews

This website uses cookies.