Asked by:
Powershell cmd to extract multiple groups and members form a specific OU to .CSV

Question
-
Hello all.
I am trying to make a powershell script to extract multiple Groups and Users display name , surname- to .csv files named per group. The groups are in a OU 5 layers deep.
corp.***.com
NA
California
groups
Los Angeles
The groups are under Los Angeles.
There are about 80 security groups.
Can you please advise me on a script or comand to extract the information Thank you.
- Edited by Hacktwoee Friday, November 30, 2018 12:16 AM
Friday, November 30, 2018 12:15 AM
All replies
-
Please read this first: This forum is for scripting questions rather than script requests.
Also find scripts here: PowerShell Gallery or here: TechNet Gallery - resources for IT professionals.
Learn PowerShell: Microsoft Virtual Academy - Getting Started with Microsoft PowerShell.
Script requests: Microsoft Technet Script Center - Requests.
There are literally thousands of examples of what you're asking for in the gallery and in this forum. Please use your favorite search engine to search for it.
Live long and prosper!
(79,108,97,102|%{[char]$_})-join''
Friday, November 30, 2018 12:42 AM -
Friday, November 30, 2018 1:10 AM
-
Hi,
Thanks for your question.
This forum is for scripting questions rather than the script requests.
You can learn something from the "Get-ADGroup" and "Get-ADGroupMember" cmdlets. Also, you can go to the links from Jrv.
Best Regards,
Lee
Just do it.
Friday, November 30, 2018 2:03 AM -
The answer to help you be the Moderator is correct using Get-ADgroup and also a search base query to start from in AD.
You can do a search by specific OU, hope this helps some:
http://scriptsbyscott.com/Get-ADuser-By-OU.html
- Proposed as answer by ComputerScott Saturday, December 1, 2018 12:11 AM
Saturday, December 1, 2018 12:10 AM