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 501581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:12:16+00:00 2026-05-13T06:12:16+00:00

Pardon my ignorance, I do not know much about AD (let lone querying with

  • 0

Pardon my ignorance, I do not know much about AD (let lone querying with AD or googling for that). I would like to get a list of all the users in a particular domain, their first name, last name and email ids. Would a network admin (or help desk in my case) be able to do that ? My other option: I have the usernames in an excel sheet, Full name in another text file (amongst other data – say XXXyy , FirstName LastName- I would have to split,parse it to extract the name) and email in another file and none of them are in order. There might be some missing data too 🙁

What would be the best way to go about it with Querying AD ?

Edit:May be I should be more specific. If I was seeing what my network admin would be doing to get me this info, what would he be doing ?

  • 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-05-13T06:12:16+00:00Added an answer on May 13, 2026 at 6:12 am

    Active Directory exposes query interface via OLE DB and ADO. The provider is "ADsDSOObject", the query syntax goes like this:

    <LDAP://mydomain.com>;(objectType=user);givenname,sn

    Perversely, the URL schema name LDAP must be capitalized.

    Excel does not have a built-in ADO client, unless you code in VBA.

    UPDATE: wrote a simple JavaScript query script for you:

    var conn = new ActiveXObject("ADODB.Connection");
    conn.Open("Provider=ADsDSOObject");
    var rs = conn.Execute("<LDAP://your-domain.com>;(objectClass=user);sn,givenname");
    var i;
    if(!rs.EOF)
    {
        rs.MoveFirst();
        while(!rs.EOF)
        {
    
            WScript.Echo(rs.Fields.Item("givenname")+","+rs.Fields.Item("sn")+"\n");
            rs.MoveNext();
        }
    }
    

    It queries the fiest and last name of all users in your domain. Place your domain name in the third line. Then save it as a .js file, and execute thusly:

    cscript adquery.js >a.txt
    

    And you’ll end up with a text file called a.txt, with the names of your users, comma-separated. Import it into Excel or something.

    In Excel, if you are willing to mess with macros, you can write a VBA function against ADO that performs the same query. Or use .NET’s DirectorySearcher, recent versions of Excel let you consume .NET objects.

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

Sidebar

Related Questions

Pardon my ignorance, but how would I begin to go about creating the following
Pardon me if this has already been asked (I know very little about Data
Pardon my newbie-ness to Java as I am not experienced enough to know the
I'm a .net developer so pardon me for not knowing anything about PHP .
Pardon my ignorance, but I've never really developed Windows applications. How do you store
Please pardon my ignorance. I'm looking for a point in the right direction. I
Pardon my ASP ignorance, but what's the difference?
Pardon the excessive amount of code, but I'm not sure if I can explain
I am sort of new to MVC so pardon my ignorance. I am using
Pardon the simple question, but I am pulling my hair out trying to get

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.