ActiveDirectory binding domain

Source: Internet
Author: User

(Turn) http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/ADSI/iadsuser. asp

To bind to a domain user through a winnt provider, use the domain name as part of the adspath, as shown in the following code example.

 
GetObject ("winnt: // mydomain/jeffsmith, user ")

Similarly, use the computer name as part of the adspath to bind to a local user.

 
GetObject ("winnt: // mycomputer/jeffsmith, user ")

In Active Directory, domain users reside in the directory. The following code example shows how to bind to a domain user through an LDAP provider.

 
GetObject ("LDAP: // Cn = Jeff Smith, ou = Sales, Dc = fabrikam, Dc = com ")

However, local accounts reside in the local SAM Database and the LDAP provider does not communicate with the local database. thus, to bind to a local user, you must go through a winnt provider as described in the second code example.

Example:
// Bind the domain and change the user password.
Direcotryentry entry = new directoryentry ("winnt: // devtest/josson", "josson", "pass");
// Bind LDAP
// New directoryentry ("LDAP: // devtest/CN = Jin, Cn = users, Dc = devtest, Dc = com", "josson", "pass");

Entry. invork ("changepassword", new object [] {oldpassword, newpassword });

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.