Active Directory, enumerating user's groups, COM exception

后端 未结 3 685
盖世英雄少女心
盖世英雄少女心 2021-01-15 18:00

while enumerating current user\'s groups through AD .NET API I sometimes get

COMException: Unknown error (0x80005000)

Here\'s my code :

3条回答
  •  醉梦人生
    2021-01-15 18:17

    0x80005000 = E_ADS_BAD_PATHNAME so you supply an invalid adspath somewhere, maybe you must add LDAP:// prefix or opposit are doing this twice? Set a breakpoint and inspect value...

    EDIT: AdsPath should be a value like "LDAP://CN=Administator,CN=Users,DC=contoso,DC=com", you seem to have a misformed path.

提交回复
热议问题