+ Post New Thread
Results 1 to 2 of 2
Windows Server 2008 Thread, AD query? in Technical; Does anyone know if it is possible to run an AD query that lists all users in the domain who ...
  1. #1
    sch
    sch is offline

    Join Date
    Oct 2009
    Location
    Norway
    Posts
    23
    Thank Post
    1
    Thanked 2 Times in 2 Posts
    Rep Power
    8

    AD query?

    Does anyone know if it is possible to run an AD query that lists all users in the domain who are members of more than 1 global security group?

    If so, do you have a suggestion in how that string might look like, or already have a similar string that you want to share?

  2. IDG Tech News
  3. #2
    TheLibrarian
    Guest
    This is quick and dirty, but should do the job you want.
    Code:
    if exist countgroups.csv del countgroups.csv
    for /f "tokens=1 delims=*" %%i in ('dsquery user -limit 2000 -samid *') do (
    for /f "tokens=1 delims=*" %%j in ('dsget user %%i -memberof ^| find /c "CN"') do (
    echo %%i,%%j >> countgroups.csv
    )
    )
    Save it to a .bat file and execute it.

SHARE:
+ Post New Thread

Similar Threads

  1. DNS Query
    By brahma in forum Windows
    Replies: 4
    Last Post: 17th July 2008, 02:33 PM
  2. Joomla query
    By tech_guy in forum Web Development
    Replies: 5
    Last Post: 29th October 2007, 08:44 PM
  3. Query of existing query data in PHP
    By markwilliamson2001 in forum Web Development
    Replies: 5
    Last Post: 5th October 2007, 08:43 AM
  4. SQL Query :S
    By Kained in forum Web Development
    Replies: 10
    Last Post: 25th July 2007, 02:56 AM
  5. Training Query
    By derer1 in forum General Chat
    Replies: 14
    Last Post: 12th February 2007, 02:10 PM

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
  •