Hi everyone,
Been racking my brain over this one for while...I grabbed this code off a different post here on these boards
$csv = get-content "d:\script\input.csv"
$result = $csv | foreach-object {
$group=$_
get-qadgroupmember "$_" -sizelimit 0 -indirect | select-object firstname,initials,lastname,logonname,title,department,company,P.O.Box,@{n="GroupName";e={$group}}
}
$result | export-csv d:\script\rebtest12.csv -notype
I am trying to get a complete listing of members in a group and all its nested groups.
The problem I am having is the following... say I have the following group structure and memberships...
Group1
User1
-----NestedGroup1
User1
-----NestedGroup2
-----NestedGroup3
The script that I pasted lists all the members, however it strips out all but one instance of each user. So if a user is a member of Group1 and Nested1, the script only returns the user as a member of Nested1.
I need to know when a user has redundant access.
Thaks in Advance, Im pretty new to powershell and may be overlooking something simple.