This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


May 10, 2015, 8:43 PM
13 Posts
topic has been resolvedResolved

Fetching users from a group in Active Directory via Lotusscript

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: active_directory,ad,users,groups,lotusscript
  • Replies: 1

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)

May 11, 2015, 6:17 PM
11 Posts
You may try ldapsearch w/ LDIF or lsxldap.dll

Hello Hogne,

I only did something like that using ldapsearch to generate a LDIF file and work with its contents as a text, line by line. Although not the most elegant option, it did work.
You can find more info about ldapsearch here:

        Using ldapsearch
        http://www-01.ibm.com/support/docview.wss?uid=swg27002627

There was a lsxldap that was used for similar goals. It used to be hosted on Notes.Net Sandbox, but I found a link for a valid file here:

        SOLUTION: Download lsxldap.dll
        http://www-10.lotus.com/ldd/nd85forum.nsf/0/20e9061e3d44402b852579830025d1a9?OpenDocument

HTH. Regards,

Edson Luis Almeida Viana


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal