I am trying to get users who are part of an AD group which is in domain ‘A’. But the users who are part of this AD group are from multiple domains ‘A’, ‘B’, ‘C’. I tried using Get-ADgroupmember command but it has a limitation in showing number of records. There are more than 6000 users in this AD group. Could you please help on this?
That’s quite vague. What does it show and what does it not show? Have you read the help for the cmdlet completely?
- This cmdlet does not work when a group has members located in a different forest, and the forest does not have Active Directory Web Service running.
Get-ADGroupMember shows only 5000 records. I have more than 6000 users
Yes I tried this as well. But the users are from multiple domains. This gives me users from only 1 domain.
(Get-ADGroup -Identity $Group -Properties Members).Members | Get-ADUser | Select-Object name,samAccountName | Export-Csv u:\groupmembers.csv