Change My Site Host URL in User Profile Service Application using PowerShell
Once the My site host web application and a site collection is created, the next step is to configure the user profile service application to use the My site host. Here is how to set my site host in user profile service application of SharePoint 2016.
- Login to SharePoint 2016 Central Administration site.
- Click on Application Management >> Manage service applications.
- Select your User Profile Service Application >> From the Manage User profile service page, click on the “Setup My Sites” link under the My Site Settings section.
- Enter the My Site Host URL and click Save. You may have to specify other settings such as Personal Site Location, Site Naming Format, Secondary Owner, etc.
Make sure your My Site URL is the default one under AAM!
PowerShell to Set My Site Host Location in SharePoint:
Let’s change my site host URL in SharePoint 2013 using PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$MySiteHostURL="https://mysite.crescent.com"
#$MySite = Get-SPSite $MySiteHostURL
$SiteContext = Get-SPServiceContext($MySiteHostURL)
$UPM = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($SiteContext)
#remove my site host location
$UPM.MySiteHostUrl = ""
#Change My Site Host location
$UPM.MySiteHostUrl = $MySiteHostURL
Write-host "My Site Host Location Changed!"