Lucky Tham
asked on
Find AD Nested Groups
Hi,
Anyone can advice how to modify below script to find few hundred nested groups?
Tks.
Lucky
Function Test-ADGroupMemberInfra {
Param ($User)
Trap {Return "error"}
$output= $User
$output+= " * "
If (Get-ADUser -Filter "memberOf -RecursiveMatch '$((Get-ADGroup "CorpSvcs_IOE_Infra&VA").D istinguish edName)'" -SearchBase $((Get-ADUser $User).DistinguishedName)) {$output+= "True "} Else {$output+= "False "}
$output
}
Test-ADGroupMemberInfra -User "jimmy05" >> d:\grp1.txt
Anyone can advice how to modify below script to find few hundred nested groups?
Tks.
Lucky
Function Test-ADGroupMemberInfra {
Param ($User)
Trap {Return "error"}
$output= $User
$output+= " * "
If (Get-ADUser -Filter "memberOf -RecursiveMatch '$((Get-ADGroup "CorpSvcs_IOE_Infra&VA").D
$output
}
Test-ADGroupMemberInfra -User "jimmy05" >> d:\grp1.txt
ASKER
I'll try it and update you. Tks.
@Lucky,
Do you have an update for this question?
Do you have an update for this question?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
https://stackoverflow.com/questions/23885149/get-recursive-group-membership-of-all-ad-users-using-powershell
Create the Following Function
See if this is what you are looking for.