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 ...
29th October 2009, 08:41 AM #1
- Rep Power
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?
IDG Tech News
29th October 2009, 09:33 AM #2
This is quick and dirty, but should do the job you want.
Save it to a .bat file and execute it.
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
By brahma in forum Windows
Last Post: 17th July 2008, 02:33 PM
By tech_guy in forum Web Development
Last Post: 29th October 2007, 08:44 PM
By markwilliamson2001 in forum Web Development
Last Post: 5th October 2007, 08:43 AM
By Kained in forum Web Development
Last Post: 25th July 2007, 02:56 AM
By derer1 in forum General Chat
Last Post: 12th February 2007, 02:10 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread