I have a list of groups that are in different domains or child domains that have members that are also in different domains or child domains. I found this forum from a while ago Get-ADGroupMember limitations with a little modification will get me the members infomation from the different domains but I can't seem to get the groups that are in the different domains.
Here is the script I'm using:
$groups = gc C:\Test-Perm\ast\Test\No-Mangedby-Set.txt
foreach($group in $groups){
Get-ADGroup -Server "GC.server.com:3268" $group -Properties member |
Select-Object -ExpandProperty member |
ForEach-Object {
$dn = $_
Get-ADUser -Server "GC.server.com:3268" $dn -Properties Name,SamAccountName, objectClass, msDS-PrincipalName,|
Select-Object $group, Name, msDS-PrincipalName, objectClass
}
}The error I get when it tries to find a group that is in a differnt domain is as followed:
Get-ADGroup : Cannot find an object with identity: 'GroupName' under: 'DC=Childomain1,DC=region,DC=company,DC=com'.Any thoughts on what I have done wrong or what I missed?
Thanks in Adavance