This topic has not yet been rated - Rate this topic

UserProfile.PersonalUrl Property

Gets the personal URL of the user.

Namespace:  Microsoft.Office.Server.UserProfiles
Assembly:  Microsoft.Office.Server.UserProfiles (in Microsoft.Office.Server.UserProfiles.dll)
public Uri PersonalUrl { get; }

Property Value

Type: System.Uri
String that shows the personal URL of the user.

This will always be an absolute URL. If a user has a backing personal site, it will be a URL to their personal site. If a user does not have a personal site, it will be a URL to the public view of their site.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Get MySite Personal url for the Current User

PersonalUrl property member gets the MYSite Personal Site Url of the User(ie., Site Collection created for the particular user) from User Profile. If the Personal Site is not available for the user, this proerpty returns the same value as Public Url.

  SPSite _site = SPContext.Current.Site;
SPServiceContext context =  SPServiceContext.GetContext(_site);

UserProfileManager profileManager = new UserProfileManager(context);

//Get the Current User Login Name
string UAccount = SPContext.Current.Web.CurrentUser.LoginName;

//Pass the Login Name to Profile Manager to get the properties for the User Profile
UserProfile u = profileManager.GetUserProfile(UAccount);

//PersonalUrl property gets the MySite Personal url of the given user
Response.Write ( u.PersonalUrl.ToString() );