ahbenshaut
Well-known member
I found the following code that is supposed to determine whether or not a user is a member of a particular Active Directory group but I am having trouble converting it to VB.net. I have added the Active DS Type Library to my project references.
Any help is greatly appreciated!
VB.NET:
Function IsMember(ByVal strDomain As String, ByVal strGroup As String, ByVal strMember As String) As Boolean
'Dim grp As Object
Dim strPath As String
Dim grp As ActiveDs.IADsGroup
strPath = "WinNT://" & strDomain & "/"
grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function