Export group membership of Security groups

How do I export the list of members of security groups in the Active Directory?  I have an OU name "Security Groups", under which I have around 200 security groups.  Each group has a bunch of members.  I want to export them, sort them by the group owner, add a page break after each owner and print it.

I have no clue about scripting.  Are there any scripts available that can do this for me.

Please help!!!

Thanks,

Juzar
jzaveriAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

karstiemanCommented:
I have written a tool for this.
I cannot upload it, so mail me and i'll send it to you.
0
karstiemanCommented:
mail me at karstenreisser at hotmail dot com
0
oBdACommented:
Chcek the batch script below, it will create a text file in the folder where you start the script.
You can then open the text file in any editor or word processing programs of your choice, and replace [Break] with any string of your choice.

karstieman,
please check EE's help (http://www.experts-exchange.com/help.jsp), under Success Tips > About using email to solve your problem:
"The use of email to resolve a question at Experts Exchange is prohibited, because it gives the emailing Expert an unfair advantage over the other participants in a question. The same applies to the use of Remote Access to resolve a problem. Points cannot be awarded for a solution that is not posted on the site."

@echo off
setlocal
set LogFile=%~dpn0.log
:: *** Set Output to DN or Name:
set Output=DN
:: *** OU in which to search the groups:
set RootOU=ou=Security Groups,dc=your,dc=domain,dc=local
 
if exist "%LogFile%" del "%LogFile%"
for /f "delims=" %%a in ('dsquery group "%RootOU%" -limit 0') do call :process %%a
goto :eof
:process
set GroupDN=%~1
for /f "tokens=2 delims=,=" %%s in ("%GroupDN%") do set GroupName=%%s
echo Processing %GroupName% ...
if /i "%Output%"=="DN" (
  >>"%LogFile%" echo %GroupDN%
) else (
  >>"%LogFile%" echo %GroupName%
)
for /f "delims=" %%a in ('dsget group "%GroupDN%" -members') do (
  if /i "%Output%"=="DN" (
    >>"%LogFile%" echo %%a
  ) else (
    for /f "tokens=2 delims=,=" %%s in ("%%a") do >>"%LogFile%" echo %%s
  )
)
>>"%LogFile%" echo [Break]
goto :eof

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
karstiemanCommented:
@oBdA: didn't know that.
My program just existed of a couple of forms and I couldn't upload it...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.