How to update the Address of an Active Directory User
1: LdapManager myLDAP = new LdapManager("192.168.1.40");
2:
3: if (!myLDAP.Login("administrator", "Passw0rd2"))
4: {
5: label1.Text = "Invalid Login";
6: return;
7:
8: }
9:
10: LdapUser oUser = myLDAP.GetUser(UserProperty.Username, "linda");
11:
12: oUser.Properties["streetaddress"] = "7733 Hollywood Blvd";
13: oUser.Properties["l"] = "Beverley Hills";
14: oUser.Properties["st"] = "CA";
15: oUser.Properties["postalcode"] = "92010";
16: oUser.Properties["co"] = "USA";
17:
18: oUser.Properties["manager"] = myLDAP.GetUser(UserProperty.Username, "larry").DistinguishedName;;
19:
20: oUser.Save();
|