Export a list of global groups plus their members

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
 
J

Jerold Schulman

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 :blush:utput %%g
)
)
endlocal
goto :EOF
:blush:utput
@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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top