大网数据广告活动
域与目录服务

Setting and Changing User Passwords with the LDAP Provider

· 52CE 我爱测

To a set a user password, use the IADsUser.SetPassword method.

To a set a user password, use the IADsUser.SetPassword method.

The LDAP provider for Active Directory uses one of three processes to set the password (third-party LDAP directories such as iPlanet do not use this password authentication process). The method may vary according to the network configuration. The set password methods occur in the following order:

  • First, the LDAP provider attempts to use Kerberos.
  • Second, if Kerberos is unsuccessful, the LDAP provider attempts to establish a Secure LDAP connection. For Secure LDAP to operate successfully, the LDAP server must have the appropriate server authentication certificate installed and the clients running the ADSI code must trust the authority that issued those certificates. Both the server and the client must support at least 128-bit encryption.
  • Third, if the Secure LDAP connection is unsuccessful, the LDAP provider attempts a NetUserSetInfo API call. In previous releases, ADSI called NetUserSetInfo in the security context in which the thread was running, and not the security context specified in the call to IADsOpenDSObject.OpenDSObject or ADsOpenObject. In later releases, this was changed so that the ADSI LDAP provider would impersonate the user specified in the OpenDSObject call when it calls NetUserSetInfo.

To change a user password, use the IADsUser.ChangePassword method. Like SetPassword, this method can use multiple processes to change the password. The change password methods occur in the same order:

  • First, the LDAP provider attempts to use Kerberos.
  • Second, the LDAP provider tries to use Secure LDAP.
  • Third, if the Secure LDAP connection is unsuccessful, the LDAP provider tries a NetUserChangePassword API call. Like SetPassword, in earlier releases, the ADSI LDAP provider impersonates the user credentials passed using the IADsOpenDSObject.OpenDSObject method or the ADsOpenObject function.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。