?
Solved

Export group membership of Security groups

Posted on 2009-05-11
4
Medium Priority
?
662 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:jzaveri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 5

Expert Comment

by:karstieman
ID: 24353614
I have written a tool for this.
I cannot upload it, so mail me and i'll send it to you.
0
 
LVL 5

Expert Comment

by:karstieman
ID: 24353644
mail me at karstenreisser at hotmail dot com
0
 
LVL 85

Accepted Solution

by:
oBdA earned 1500 total points
ID: 24354462
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
 
LVL 5

Expert Comment

by:karstieman
ID: 24354489
@oBdA: didn't know that.
My program just existed of a couple of forms and I couldn't upload it...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question