How to change SharePoint My Site Host Url using Power Shell
$AnySiteCollectionUrl = "http://SPSite/"
$site = Get-SPSite $AnySiteCollectionUrl
$context = Get-SPServiceContext($site)
$pm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
Write-Host "previous My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow;
$pm.MySiteHostUrl = ""
$pm.MySiteHostUrl = "http://mysiteurl/"
Write-Host "new My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow;
$site.Dispose()
$site = Get-SPSite $AnySiteCollectionUrl
$context = Get-SPServiceContext($site)
$pm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
Write-Host "previous My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow;
$pm.MySiteHostUrl = ""
$pm.MySiteHostUrl = "http://mysiteurl/"
Write-Host "new My Site Host Url: " $pm.MySiteHostUrl -ForegroundColor Yellow;
$site.Dispose()
Comments
Post a Comment