B
Brad Mann
I am looking for a low cost way of determining whether a user is a member of
a specific group in ActiveDirectory. Does anyone know of a quick a dirty way
to do this? I currently go and get the collection of groups to which a user
belongs, then iterate through them to see if the name of the group matches
the one sent into my function. I am hoping to find an easier way to do
this.
Here is a sample of the code which is currently being used:
strPath = "WinNT://OURSERVER.COM/" & GetCurrentUser() & ",user"
objDirEnt = New DirectoryEntry(strPath)
objGroups = objDirEnt.Invoke("Groups")
For Each objGroup In objGroups
objGroupDirEnt = New DirectoryEntry(objGroup)
If Trim(objGroupDirEnt.Name) = Trim(strGroup) Then blnIsMember = True
Next
Thanks,
Brad
a specific group in ActiveDirectory. Does anyone know of a quick a dirty way
to do this? I currently go and get the collection of groups to which a user
belongs, then iterate through them to see if the name of the group matches
the one sent into my function. I am hoping to find an easier way to do
this.
Here is a sample of the code which is currently being used:
strPath = "WinNT://OURSERVER.COM/" & GetCurrentUser() & ",user"
objDirEnt = New DirectoryEntry(strPath)
objGroups = objDirEnt.Invoke("Groups")
For Each objGroup In objGroups
objGroupDirEnt = New DirectoryEntry(objGroup)
If Trim(objGroupDirEnt.Name) = Trim(strGroup) Then blnIsMember = True
Next
Thanks,
Brad