I'm trying, via Lotusscript, to list all in a given group in Active Directory to present in an html table on a web page.
In PowerShell, I can use the following command: Set objContainer = GetObject("LDAP://OU=<department_name>,OU=Users and Groups,OU=<our town>,DC=<our domain>,DC=com")
How must I phrase that command in Lotusscript?
I have been able to find a given username inside AD and present in in a Messagebox via this code:
Dim objRecordSet As Variant
Dim objConnection As Variant
Dim objCommand As Variant
Dim Test As String
Dim strGroup As String
Dim strLdapFilter
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
'test = objConnection.DefaultDatabase
Set objCommand = CreateObject("ADODB.Command")
Set objCommand.ActiveConnection = objConnection
strGroup = "OU=ICT Department,OU=Users and Groups,OU=Molde"
'Modify the next line's dc and username (sAMAccountName) to match your environment
'objCommand.CommandText = "<GC://dc=<our domain>,dc=com>;" & "(&(objectCategory=person)(objectClass=user)" & "(sAMAccountName=" & strUserName & "));" & "sAMAccountName, distinguishedName;subtree"
Set objRecordSet = objCommand.Execute
If objRecordSet.RecordCount = 0 Then
MsgBox "The sAMAccountName is not in use."
Else
While Not objRecordset.EOF
MsgBox "sAMAccountName = " & _
objRecordset.Fields("sAMAccountName").value
MsgBox "distinguishedName = " & _
objRecordset.Fields("distinguishedName").value
objRecordset.MoveNext
Wend
End If
objConnection.Close
However, if I try to amend this code to instead listing out user info on each member of a given AD-group, I'm only getting error messages.
Has anyone ever done this? (And no, the HADSL directory picker is not an option here)