?
Solved

Active Directory Export Script

Posted on 2014-03-05
4
Medium Priority
?
289 Views
Last Modified: 2014-10-17
Dear Experts,

Please could somebody help me devise a script that will export the following from Active Directory:

Domain; User; OU; Security Group;

and output to a CSV file.

I want to be able to run this on a number of different domains.

It'll be mainly on 2003 domains so I'm not sure we can use PowerShell.

Many thanks
0
Comment
Question by:andymellor
[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
4 Comments
 
LVL 11

Assisted Solution

by:Giladn
Giladn earned 668 total points
ID: 39907472
0
 
LVL 2

Assisted Solution

by:allen_rich
allen_rich earned 664 total points
ID: 39908741
Check below script. It might be helpful for you.

$results = @()

$groups = Get-ADGroup -Filter * -SearchBase $OU

foreach ($group in $groups) {

$members = $group | Get-ADGroupMember

$results += New-Object psObject -Property @{'GroupName'=$group;'Members'=$members}

}

$results | Export-Csv 'GroupsAndMembers.csv' -NoTypeInformation


or


Get-ADGroup -Filter * -SearchBase $OU | select -ExpandProperty name | % {

$group= "$_"

$result += Get-ADGroupMember -identity "$_" | select @{n="Group";e={$group}},Name

}

$result | export-csv 'membership.csv' -notypeinformation
0
 
LVL 18

Accepted Solution

by:
Sarang Tinguria earned 668 total points
ID: 39911238
Chris has a great GUI tool for all theese stuffs

Cjwdev | AD Info - Active Directory Reporting www.cjwdev.co.uk/Software/ADReportingTool/Info.html
0
 

Author Comment

by:andymellor
ID: 40386712
Great Help!
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
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

718 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