首页 > 解决方案 > 活动目录。检索成员 distinctName 时发生以下异常:发生操作错误

问题描述

我尝试使用 LDAP 从 AD 获取信息。之前,我通过 DSAMAIN 在 localhost:5000 安装了 ntds.dit。

PS C:\Users\Administrator> ([ADSI]"LDAP://localhost:5000/")
format-default : The following exception occurred while retrieving member "distinguishedName": "Unknown error
(0x80005000)"
    + CategoryInfo          : NotSpecified: (:) [format-default], ExtendedTypeSystemException
    + FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand
PS C:\Users\Administrator> ([ADSI]"LDAP://localhost:5000/DC=srv,DC=local")
format-default : The following exception occurred while retrieving member "distinguishedName": "An operations error
occurred.
"
    + CategoryInfo          : NotSpecified: (:) [format-default], ExtendedTypeSystemException
    + FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand
PS C:\Users\Administrator> [ADSI]::Exists("LDAP://localhost:5000/DC=srv,DC=local")
Exception calling "Exists" with "1" argument(s): "An operations error occurred.
"
At line:1 char:1
+ [ADSI]::Exists("LDAP://localhost:5000/DC=srv,DC=local")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DirectoryServicesCOMException
PS C:\Users\Administrator> [adsi]"LDAP://localhost:5000/RootDSE"

distinguishedName : {}
Path              : LDAP://localhost:5000/RootDSE 

我做错了什么?

标签: active-directoryldap

解决方案


推荐阅读