Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.

How to test ADsDSOObject outside of QlikView/Qlik Sense

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

How to test ADsDSOObject outside of QlikView/Qlik Sense

Last Update:

Mar 7, 2023 4:07:52 AM

Updated By:

Sonja_Bauernfeind

Created date:

Mar 7, 2023 4:06:48 AM

OLE DB Provider for Microsoft Directory Services (ADsDSOObject) may not work in a reload script. A possible way to verify if the connection or query are otherwise correct, you will need to test it without using QlikView or Qlik Sense. 
 
Resolution
  1. Create a text file with the following content:

    Const ADS_SCOPE_SUBTREE = 2
    Set objStdOut = WScript.StdOut
    Set objConnection = CreateObject("ADODB.Connection")
    Set objCommand =   CreateObject("ADODB.Command")
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"
    Set objCommand.ActiveConnection = objConnection
    objCommand.CommandText = "Select name, distinguishedName  from 'LDAP://DC=domain,DC=local' where objectCategory='person'"  
    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Timeout") = 30 
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
    objCommand.Properties("Cache Results") = False 
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
        wScript.echo "Name: " & objRecordSet.Fields("name").Value
        wScript.echo "Distinguished name: " & objRecordSet.Fields("distinguishedName").Value
        objRecordSet.MoveNext
    Loop

    • Change the LDAP address after from corresponding to your domain name. For example address for domain named "Domain.Local" is LDAP://DC=domain,DC=local (red highlighted in the example)
    • Modify the query as needed: select more or fewer fields, adjust the WHERE clause, etc.
    • For each query field, add a wScript.echo command in the loop at the end of the script to write filed values to console (blue highlighted in the example). 

  2. Save the test file with extension .vbs. For example test.vbs
  3. Open command line, navigate to vbs file path. Execute the following command: 

    C:\Windows\system32\cscript.exe test.vbs

    Make sure to open Windows command line under the same user running QlikView Desktop or Qlik Sense services. This should print results of the query to command line console, similar to the following:

    test vbs output.png

 

If the same query doesn't work in this VBScript either, then the issue lies at the OLE DB provider ADsDSOObject rather than QlikView or Qlik Sense.

Reference to the VBScript used: Getting started with scripting for ADSI

 

Environment

QlikView 
Qlik Sense Enterprise on Windows 

Labels (1)
Contributors
Version history
Last update:
‎2023-03-07 04:07 AM
Updated by: