I am new to lotus notes development.I’m trying to read off information from our Microsoft Active Directory.
I found this working code somewhere:
Dim objConnection As Variant
Dim objCommand As Variant
Dim Test As String
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"<LDAP://server>;" & _
"(&(objectCategory=group)" & _
"(sAMAccountName=AD Group*));" & _
"sAMAccountName;subtree"
Set objRecordSet = objCommand.Execute
Dim groups As String
If objRecordSet.RecordCount = 0 Then
Msgbox "The sAMAccountName is not in use."
Else
While Not objRecordset.EOF
groups = groups & "," & objRecordset.Fields("sAMAccountName").Value
objRecordSet.MoveNext
Wend
Msgbox(groups)
End If
objConnection.Close
Anyway, what I need now is to find all the members belonging to a group? Anyone knows how can this be achieved? Or are there alternative ways of doing this.
thank you