Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

group member search in entire forest including child domain as well

$
0
0

Hi 

I am using below script to get the group member search. This script is taking time.. 

Any idea to modify it or get more fast search script..

I have 4 child domain and 2 root domain in single forest.

$domains = (Get-ADForest).domains
$Members = foreach ($domain in $domains) {
    $Group = Get-ADGroup -Filter { Name -like "*PARTNERS" } -Server $Domain 
    $Group | Get-ADGroupMember -Server $domain | Select @{Name="Domain";Expression={$Domain}},@{Name="Group";Expression={$Group.Name}},Name


}
     
$Members | sort Domain,Group,Name | Out-File group.csv


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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