How can I print in which groups the current user is by the active directory?
I want to print groups that contain the current user in cells.
How can I print in which groups the current user is by the active directory?
I want to print groups that contain the current user in cells.
Function IsMember(strDomain As String, strGroup _
As String, strMember As String) As Boolean
Dim grp As Object
Dim strPath As String
strPath = "WinNT://" & strDomain & "/"
Set grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function
I solved my work with these codes Determining a User's Group Membership using VBA