Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Running through a grouped ouput (like in the attached picture)

$
0
0

Hey Folks,

I have a Problem with my Powershell script...

I like to filter all users who are responsible ("ManagedBy Attribute" in the AD) for some Groups in my active Directory. I've done this by:

$managedByUsers = Get-ADGroup -filter{name  -like '*DFS-IST-*'} -properties info, member, ManagedBy | Group-Object ManagedBy

Then I get all Groups where a user is responsible for, like in the Picture, User 1 is responsible for DFS-I-Test1 and DFS-I-Test2:

But now I have to work with those Groups, like in the following pseudo code:

FOREACH $managedByUsers.name{

FOR EACH $managedByUsers.Group{

Do something A: Here I have to work with the Name of each Group, filtering some informations out of the AD and handle the next group}

Then Do something B

AND

Take The Next $managedByUsers.Name until all of them are handled

}

}

I hope you understand what I'm trying to do and someone can help me...! Thanks a lot!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>