My web application is an ASP.NET MVC 4 web application using HTML5 and Jquery.
I'm writing a web application to retrieve and edit data from a Sharepoint server using Active Directory.
I'm able to retrieve information fine, but I'm trying to figure out a way to edit and commit changes to an active directory account. I haven't been able to find code samples anywhere that pertain to remote web application access. The only samples of editing I've seen can only be done on the SharePoint server.
I'm wondering if we're missing something entirely about Active Directory and if what I'm trying to do is even possible.
NOTE:
I haven't been able to find code for editing Active Directory information as of yet. This is the code I have so far for retrieval. I want to be able to pull back information, edit a property such as First Name or Last Name, and then commit the changes to SharePoint Active Directory.
Thanks in advance for your answers!
ClientContext currentContext = new ClientContext(serverAddress);
currentContext.Credentials = new System.Net.NetworkCredential(adminAccount, password);
const string targetUser = "domain\\targetAccountName";
Microsoft.SharePoint.Client.UserProfiles.PeopleManager peopleManager = new Microsoft.SharePoint.Client.UserProfiles.PeopleManager(currentContext);
Microsoft.SharePoint.Client.UserProfiles.PersonProperties personProperties = peopleManager.GetPropertiesFor(targetUser);
currentContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
currentContext.ExecuteQuery();
foreach (var property in personProperties.UserProfileProperties)
{
//Pull User Account Name
//Edit Account name to new value
//Commit changes
}