OK, I am new to Powershell scripting but here is the problem that I have.
I need a script that will list all groups in the forest ( this is one forest with 3 domains) recursively and list all circular nested groups across the forest.
The current forest has +30000 groups. Nesting goes at least 5 levels deep and 1 group can have several hundreds of nested groups.
I started by filtering out all the groups that are top level groups and are not a member of any other group but then I got stuck.
Can someone put me on the right track how to go from here
circular nested groups across a forest
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: circular nested groups across a forest
Hey Thnx for your answer but this does not seem correct:
So please correct me if I'm wrong
Get-adgroup does not support -recurse or -recursive
So please correct me if I'm wrong
Get-adgroup does not support -recurse or -recursive
Re: circular nested groups across a forest
Hey
The first part works fine but the part after the pipeline generates an error
[Get-ADGroupMember] , NotSupportedException
The operation is not supported on global catalog port
The first part works fine but the part after the pipeline generates an error
[Get-ADGroupMember] , NotSupportedException
The operation is not supported on global catalog port
Re: circular nested groups across a forest
Then you will have to do it this way:
- Get-AdGroup -Filter * -Server sbs01:3268 |
- ?{$_.objectclass -eq 'group'}|
- %{Get-AdGroupMember $_.DistinguishedName -Recursive} |
- ?{$_.objectclass -eq 'group'}