Solved

Active Directory Export Script

Posted on 2014-03-05
4
263 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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.

777 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