Solved

Active Directory Export Script

Posted on 2014-03-05
4
256 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
4 Comments
 
LVL 11

Assisted Solution

by:Giladn
Giladn earned 167 total points
Comment Utility
0
 
LVL 2

Assisted Solution

by:allen_rich
allen_rich earned 166 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Great Help!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now