Which domain groups is a user in?

A console application to determine which groups a user is in:

My.User.InitializeWithWindowsUser() Dim identity As System.Security.Principal.WindowsIdentity = TryCast(My.User.CurrentPrincipal.Identity, System.Security.Principal.WindowsIdentity) Debug.WriteLine(identity.Name) For Each group As System.Security.Principal.SecurityIdentifier In identity.Groups() Debug.WriteLine(group.Translate(GetType(System.Security.Principal.NTAccount)), “group”) Next

Comments

One response to “Which domain groups is a user in?”

  1. Brittany D Avatar

    Very niice blog you have here

Leave a comment