当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 使用 PowerShell 在 User Profile Service 应用程序中更改我的网站主机 URL

作者:精品下载站 日期:2024-12-14 14:19:16 浏览:13 分类:玩电脑

使用 PowerShell 在 User Profile Service 应用程序中更改我的网站主机 URL


创建“我的网站”主机 Web 应用程序和网站集后,下一步是将用户配置文件服务应用程序配置为使用“我的网站”主机。以下是如何在 SharePoint 2016 的用户配置文件服务应用程序中设置我的网站主机。

  1. 登录到 SharePoint 2016 管理中心网站。
  2. 单击应用程序管理>>管理服务应用程序。
  3. 选择您的 User Profile Service 应用程序 >> 在“管理用户配置文件服务”页面中,单击“我的网站设置”部分下的“设置我的网站”链接。

    [玩转系统] 使用 PowerShell 在 User Profile Service 应用程序中更改我的网站主机 URL

  4. 输入“我的网站主机 URL”并单击“保存”。您可能需要指定其他设置,例如个人站点位置、站点命名格式、第二所有者等。
确保您的“我的网站”URL 是 AAM 下的默认 URL!

PowerShell 在 SharePoint 中设置我的网站主机位置:

让我们使用 PowerShell 更改 SharePoint 2013 中的网站主机 URL:


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!"

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯