Link to home
Start Free TrialLog in
Avatar of Jay Thomas
Jay ThomasFlag for United Kingdom of Great Britain and Northern Ireland

asked on

PS script to enumerate 25 OUs, look for 2 groups and pull membersl

Hi all.
I look at this question and know that to you PS experts it's an eay one - but not all of us pick up scripting that easy (I did offer to pay for training via a EE-gig lst year, but nothing really came of it ;0)

So, i have 25 OUs under the UK parent OU. Flat straucture here - all 25 OUs under UK. These OUs have many groups assigned to them. You know the thing, it's got a bit out of contol. What i need is a script that can loop through all 25 OUs looking for 2 groups called 'UKSouth' and UKNorth' and from here do 2 actions. Output the group names to a spreadsheet for each OU where they are found and also record the list of users in those groups. Is this something easily achieveble?
Appreciate your looking thank you.
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

Hi what version is your Windows server (Active Directory)?
Avatar of Jay Thomas

ASKER

Hi, sorry, should have mentioned, it's 2008 R2
I'd need also the Domain name and the Distinguished name of your "UK" OU.
Hi, so it's external facing domain. Could we call it contoso.com and a DN of "ou=uk,dc=contoso,dc=com
I could change there after? Hope this doesn't show a miss trust ???
Nope, it doesn't really matter I'd do the logic to find that out in the script. Give me a bit. We gotta go step by step.
Thank you very much
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much chaps. I'll try these tomorrowand eport back. Thank you again.
Thank you for your efforts. Sorry for the late feedback, just not had time to test both scripts. Thank you.