Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8761269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:14:44+00:00 2026-06-13T15:14:44+00:00

I managed to get ADS users without specifying authentication details from my ADS domain(ex,mydomain.com).

  • 0

I managed to get ADS users without specifying authentication details from my ADS domain(ex,mydomain.com). I used ADODB.Connection and ADODB.Command.

I also have sub-domains like test.mydomain.com. How to get user details from sub-domain, by specifying authentication details of a user belonging to test.mydomain.com .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:14:46+00:00Added an answer on June 13, 2026 at 3:14 pm

    You can query records from trusted domains by using their LDAP name as the search base. However, since the DC of the parent domain doesn’t contain the information about objects in the child domain it will generate a referral. The ADODB.Command object won’t automatically chase that referral, because the respective named property "Chase referrals" defaults to 0x00 (ADS_CHASE_REFERRALS_NEVER). You have to set the property to one of the following two values

    • ADS_CHASE_REFERRALS_SUBORDINATE (0x20)
    • ADS_CHASE_REFERRALS_ALWAYS (0x60)

    to make your query follow the referral. Example:

    base   = "<LDAP://dc=test,dc=example,dc=org>"
    filter = "(&(objectCategory=computer)(name=foo*))"
    attr   = "name,description"
    scope  = "subtree"
    
    Set conn = CreateObject("ADODB.Connection")
    conn.Provider = "ADsDSOObject"
    conn.Open "Active Directory Provider"
    
    Set cmd = CreateObject("ADODB.Command")
    Set cmd.ActiveConnection = conn
    cmd.CommandText = base & ";" & filter & ";" & attr & ";" & scope
    cmd.Properties("Chase referrals") = &h60  ' <-- here
    
    Set rs = cmd.Execute
    

    I wrote a wrapper class (ADQuery) to encapsulate the boilerplate code for Active Directory queries (because I got fed up with writing it over and over again). With that you could simplify the above to something like this:

    Set qry = New ADQuery
    qry.SearchBase = "dc=test,dc=example,dc=org"
    qry.Filter     = "(&(objectCategory=computer)(name=foo*))"
    qry.Attributes = Array("name", "description")
    
    Set rs = qry.Execute
    

    Either way you may still need to run the script on a DC, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I managed to get authentication to work by following the tutorial from this page
managed to get my xsl working at http://www.xmlper.com/ (great tool good recommendation from other
I managed to get some help from a previous question and I have the
Has anyone managed to get administration rights through the UAC without restarting the application
I managed to get it working on Win32 (inheriting from wx.MiniFrame does the trick),
I've managed to get my routes set up (with help from these questions Routing
Hi I have managed to get my form to submit without reloading, using this
I managed to get an auth token from the AccountManager on Android for writely
I managed to get a notification from our app to appear on the Notification
Well, I managed get the delegate driver to set up properly, but connection pooling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.