由于Powershell发生内部错误,服务器无法处理请求

由于内部错误,服务器无法处理请求

在AD中为某些用户帐户运行Get-ADPrincipalGroupMembership帐户Powershell命令时遇到了以下错误消息。

我彻底search了互联网,找不到多less东西,所以我一直在挖掘,打开详细的,跟踪,testing,比较等等。

我终于find了原因和解决scheme(在我的情况),所以我想在这里发布这个问题和答案,因为我在我的故障排除过程中找不到其他地方。

这可以帮助某人得到一个快速的解决scheme,并且如果他们正在处理紧急的或关键的问题时,可以节省一些麻烦


完整的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 

原因(就我而言)

  1. 在AD中有一个OU,其中一个帐户在OU中有一个[ / ]正斜杠字符。
  2. AD中有一个Group Name ,还包含一个[ / ]正斜杠字符。

解决scheme(在我的情况)

  1. 我从OU和组名中删除了所有正斜杠字符,并且所有事情都按预期工作。

    • 我知道这些组没有LDAP或任何其他系统中设置的任何硬编码OUpath或映射,所以在我的情况下,简单地replace无效字符是一个足够的解决scheme。

您可能没有访问AD的权限