0
4

1 回答 1

0

如果您的域在同一个林中并且您的帐户具有适当的安全性,您可以运行:

Get-ADPrincipalGroupMembership -Identity User1
Get-ADPrincipalGroupMembership -Identity User1 -ResourceContextServer Domain2

您可能需要为域 1 指定服务器:

Get-ADPrincipalGroupMembership -Identity User1 -Server Domain1
Get-ADPrincipalGroupMembership -Identity User1 -Server Domain1 -ResourceContextServer Domain2

或者类似这样的更通用的解决方案:

$Domains = Get-ADForest | Select-Object -ExpandProperty Domains
$GroupMembership = foreach ($Domain in $Domains) {
    Get-ADPrincipalGroupMembership -Identity User1 -ResourceContextServer $Domain
}
于 2018-01-22T14:21:53.517 回答