-1

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.

braX
  • 11,506
  • 5
  • 20
  • 33
Vkonca
  • 33
  • 5
  • Hi, welcome to SO. As SO is not a code writing service, the way it works is that you make an attempt to resolve your issue. If you still have problems, post your code here and we can help to resolve issues in your code but you have to make an attempt – Zac Mar 31 '20 at 10:49
  • Check this https://stackoverflow.com/questions/416856/determining-a-users-group-membership-using-vba – user2316116 Apr 01 '20 at 11:44

1 Answers1

0
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

Vkonca
  • 33
  • 5