Create and Modify User Profiles in the User Profile Store of SharePoint
This example creates a user profile from the master connection configured on the server. It displays the message 'User profile created' after a successful execution. //Creates a user profile. Obtains the property values from the default //domain controller or the master connection that is configured on the //server using System; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.SharePoint; using Microsoft.Office.Server; using System.Web; namespace UserProfilesConsoleApp { class Program { static void Main(string[] args) { try { using (SPSite site = new SPSite("http://servername")) { ServerContext context = ServerContext.GetContext(site); UserProfileManager profileManager = new UserProfileManager(context); string sAccount = "domainname\\username"; if (!profileManager.UserExists(sAccount)) { UserProfile profile = profileMana...