>I have a window forms app I'm adding security to. How can I determine what groups the logged in user belongs to?
Something like this?
Imports System.Security.Principal
Dim CurrentUser As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim strUserName As String = Replace(CurrentUser.Name, "\", "/")
Dim objWMI As Object
objWMI = GetObject("WinNT://" & strUserName)
Dim Group As Object
Dim Groups As String = ""
For Each Group In objWMI.Groups()
Groups += Group.Name + vbCr
Next
MsgBox(Groups, MsgBoxStyle.Information, "Group memberships")