Hi,
How can we add/update Active Directory through SharePoint site with in the same domain?
Please share your ideas.
Thanks in Advance,
Balakrishna M.
I am not aware of an out-of-the-box feature that does this. I personally created a SharePoint Timer Job which gathers the updates I want to perform and then updates the Active Directory using the System.DirectoryServices namespace:
I am not a full-time developer, but I found many resources on the web on how to create/update a user in the Active Directory. Here is an extract of my code that creates a user object in AD, to help you started, but many parameters depend on your own environment of course:
               DirectoryEntry MyObject = new DirectoryEntry();
               MyObject.Path = “LDAP://DC=SomeDomain”;
               DirectoryEntries users = MyObject.Children;
               DirectoryEntry NewUser = users.Add(“CN=” + LastName + ” ” + FirstName, “User”);
               NewUser.Properties[“sAMAccountName”].Add(UserName);
               NewUser.Properties[“givenName”].Add(FirstName);
               NewUser.Properties[“sn”].Add(LastName);
               NewUser.Properties[“displayName”].Add(LastName + ” ” + FirstName);
               NewUser.Properties[“description”].Add(description);
               NewUser.Properties[“mail”].Add(Email);
               NewUser.Properties[“userPrincipalName”].Add(UserName + “@domain.com”);
               NewUser.CommitChanges();
               NewUser.Invoke(“SetPassword”, new object[] { Password });
               NewUser.CommitChanges();
               NewUser.Properties[“userAccountControl”].Value = 0x200;
               NewUser.CommitChanges();
               int val;
               const int ADS_UF_DONT_EXPIRE_PASSWD = 0x10000;
               val = (int)NewUser.Properties[“userAccountControl”].Value;
               NewUser.Properties[“userAccountControl”].Value = val |
                   ADS_UF_DONT_EXPIRE_PASSWD;
               NewUser.CommitChanges();
Using this, you can gather your User Profile service for example (using Microsoft.Office.Server.UserProfiles namespace) and perform the updates you want.