3

I can't fullfil the operation that update a domain accounts information like "company","manager","department"...etc.

Following are my two ways

1: DirectoryEntry de = new DirectoryEntry("LDAP://");

    de.InvokeSet("company", new Object[] { "UpdateCompany" });
       de.Username = "testname";
       de.Password = "test@6789";
       de.AuthenticationType = AuthenticationTypes.Secure;
       de.CommitChanges();

2: UserPrincipal up = new UserPrincipal(insPrincipalContext); up.Name = "lijen";

   PrincipalSearcher insPrincipalSearcher = new PrincipalSearcher();
   insPrincipalSearcher.QueryFilter = up;
   PrincipalSearchResult<Principal> results = insPrincipalSearcher.FindAll();

way1 doesn't work, the user's company doesn't change any more! Why?

Doesn't get the method to update the company property by a UserPricipal object. Please help! Thanks a lot.

cc5zhenhua
  • 145
  • 3
  • 15

0 Answers0