Export a list of global groups plus their members

  • Thread starter Thread starter paul.cina
  • Start date Start date
P

paul.cina

Hi,

I need to export two lists from our 2003 domain:

1) A list of all the global groups on our domain
2) A list shopwing all the users in each global group

Can anyone give me any suggestions? I'm sure I can do this with
dsget/ldfde - just not sure how?

Thanks
 
Hi,

I need to export two lists from our 2003 domain:

1) A list of all the global groups on our domain
2) A list shopwing all the users in each global group

Can anyone give me any suggestions? I'm sure I can do this with
dsget/ldfde - just not sure how?

Thanks


See tip 6820 » What are the new Active Directory command-line tools in Windows Server 2003?
in the 'Tips & Tricks' at http://www.jsifaq.com

Run GG.bat which contains:

@echo off
setlocal ENABLEDELAYEDEXPANSION
if exist GGList.txt del /q GGList.txt
if exist GGMbrs.txt del /q GGMbrs.txt
for /f "Tokens=*" %%g in ('dsquery group -O DN -Limit 0') do (
for /f "Tokens=1*" %%a in ('dsget group %%g -secgrp -scope^|find " yes "') do (
if "%%a" EQU "global" call :output %%g
)
)
endlocal
goto :EOF
:output
@echo %1>>GGList.txt
for /f "Tokens=*" %%m in ('dsget group %1 -members') do (
@echo %1;%%m>>GGMbrs.txt
)


The output is in 2 files in the current directory:
GGList.txt
GGMbrs.txt

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top