+ Post New Thread
Results 1 to 4 of 4
Windows Thread, query for AD in Technical; Hi I need to run an ad query to get all active usernames in an ou? thanks...
  1. #1

    Join Date
    Feb 2008
    Posts
    326
    Thank Post
    51
    Thanked 3 Times in 3 Posts
    Rep Power
    14

    query for AD

    Hi I need to run an ad query to get all active usernames in an ou?

    thanks

  2. #2


    Join Date
    Oct 2006
    Posts
    3,412
    Thank Post
    184
    Thanked 356 Times in 285 Posts
    Rep Power
    149
    can you not select an "active? true/faulse" column with;?
    AD users & computers
    view
    add/remove columns

    right click, export to csv

  3. #3

    Join Date
    Feb 2008
    Posts
    326
    Thank Post
    51
    Thanked 3 Times in 3 Posts
    Rep Power
    14
    Hi I can get a list of active users in a ou, the only thing I cant get working is to list the username?


    (&(objectCategory=person)(objectClass=user)(!(user AccountControl:1.2.840.113556.1.4.803:=2)))


    Thanks

  4. #4
    DrPerceptron's Avatar
    Join Date
    Dec 2008
    Location
    In a house
    Posts
    926
    Thank Post
    34
    Thanked 134 Times in 114 Posts
    Rep Power
    41
    You could also look at dsquery

    They're both functions of DC's and are pretty simple to use but very scalable.

    Code:
    dsquery user OU=Sales,DC=Contoso,DC=Com -o samid >> c:\usernames.txt

    Will list the users in an OU, you can also filter that by the last logon time... but I can't remember that off the top of my head (I did it a couple of days ago and this is all I remember) - it's well documented on the net and in technet.

SHARE:
+ Post New Thread

Similar Threads

  1. AD query?
    By sch in forum Windows Server 2008
    Replies: 1
    Last Post: 29th October 2009, 09:33 AM
  2. Yet another webcam query
    By LeMarchand in forum Hardware
    Replies: 9
    Last Post: 3rd April 2009, 03:38 PM
  3. Moodle Query
    By edsa in forum Virtual Learning Platforms
    Replies: 3
    Last Post: 2nd April 2009, 04:52 PM
  4. Query of existing query data in PHP
    By markwilliamson2001 in forum Web Development
    Replies: 5
    Last Post: 5th October 2007, 08:43 AM
  5. SQL Query :S
    By Kained in forum Web Development
    Replies: 10
    Last Post: 25th July 2007, 02:56 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •