Solved

Active Directory Export Script

Posted on 2014-03-05
4
280 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 167 total points
ID: 39907472
0
 
LVL 2

Assisted Solution

by:allen_rich
allen_rich earned 166 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 167 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Let's recap what we learned from yesterday's Skyport Systems webinar.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 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