1using Microsoft.Office.Server;
2using Microsoft.Office.Server.Administration;
3using Microsoft.Office.Server.UserProfiles;
4using Microsoft.SharePoint;
5using System.Web;
6
7
8namespace UserProfileCreate
9{
10class Program
11{
12static void Main(string[] args)
13{
14
15using (SPSite site = new SPSite("http://servername"))
16{
17ServerContext context = ServerContext.GetContext(site);
18UserProfileManager profileManager = new UserProfileManager(context);
19
20string accountName = "domainname\\username";
21UserProfile userProfile;
22if (profileManager.UserExists(accountName))
23{
24userProfile = profileManager.GetUserProfile(accountName);
25
26userProfile.CreatePersonalSite();
27
28}
29}
30}
31}
32}
33
34