由于内部错误,服务器无法处理请求
Get-ADPrincipalGroupMembership
在 AD 中为某些用户帐户运行帐户 Powershell 命令时,我遇到了以下错误消息。
我在互联网上彻底搜索,并没有找到太多,所以我一直在挖掘,打开verbose,跟踪,测试,比较等等。
我终于找到了原因和解决方案(在我的情况下),所以我想在这里发布这个问题和答案,因为在我的故障排除过程中我在其他地方找不到太多。
如果他们正在处理紧急或关键的事情,这可能会帮助他们快速获得解决方案并避免他们的一些头痛。
完整的 Powershell 错误消息
PS C:\Users\User> Get-ADPrincipalGroupMembership <AccountName>
Get-ADPrincipalGroupMembership : The server was unable to process the request due to an
internal error. For more information about the error, either turn on
IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the
<serviceDebug> configuration behavior) on the server in order to send the exception
information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0
SDK documentation and inspect the server trace logs.
At line:1 char:1
+ Get-ADPrincipalGroupMembership <AccountName>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (<AccountName>:ADPrincipal) [Get-ADPrincipalGr
oupMembership], ADException
+ FullyQualifiedErrorId : The server was unable to process the request due to an inter
nal error. For more information about the error, either turn on IncludeExceptionDetai
lInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configurati
on behavior) on the server in order to send the exception information back to the clie
nt, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and i
nspect the server trace logs.,Microsoft.ActiveDirectory.Management.Commands.GetADPrinc
ipalGroupMembership
原因(就我而言)
/
所在的 OU 名称中有一个 [] 正斜杠字符。Group Name
其中还包含一个 [/
] 正斜杠字符。解决方案(在我的情况下)
我从 OU 和组名中删除了所有正斜杠字符,之后一切都按预期工作。