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

[玩转系统] SharePoint Online:如何更改用户的显示名称?

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

SharePoint Online:如何更改用户的显示名称?


要求:使用 PowerShell 更改 SharePoint Online 中的用户显示名称。

如何更改 SharePoint Online 中用户的显示名称?

使用 SharePoint Online 时,有时可能需要更新用户的显示名称。也许您有一位员工的姓氏已更改,您需要更改他们在系统中的姓名。在这篇博文中,我们将向您展示如何更新 SharePoint Online 中用户的显示名称。

如果您的 Office 365 租户配置为从本地 Active Directory 同步用户帐户,请先更改那里的用户名!然后它将传播到 Office 365,然后传播到 SharePoint Online。如果您启用了双向同步或从 Office 365 门户管理用户帐户,请执行以下操作来更改用户显示名称:

  1. 登录 Microsoft 管理中心:https://admin.microsoft.com。
  2. 展开用户 >> 活动用户 >> 搜索并选择用户。
  3. 在用户属性面板中,单击“管理联系信息”链接,然后更新用户的显示名称并单击“保存更改”。

    [玩转系统] SharePoint Online:如何更改用户的显示名称?

这会更改 Office 365 中的用户名,并且 SharePoint 用户配置文件同步计时器作业在执行后最终会反映此更改。

使用 PowerShell 更新 Azure AD 中的用户显示名称

上述步骤可以使用 PowerShell 编写脚本。确保已安装 Azure AD PowerShell 模块(如果没有,请使用 Install-Module -Name AzureAD 安装)


Import-Module AzureAD -DisableNameChecking

#Parameter - Login ID of the User
$UPN = "[email protected]"
$Displayname = "Steve Johnson"

#Connect to Azure AD
Connect-AzureAD -Credential (Get-Credential)

#Change Display Name of the User
Set-AzureADUser -ObjectId $UPN -Displayname $Displayname

使用 PowerShell 更改 SharePoint Online 中的用户显示名称

以下是手动更新显示名称的 PowerShell:

请注意,上述 PowerShell 脚本仅更新给定站点的用户显示名称。您可能必须循环访问租户中的每个网站并更改用户的显示名称,因为用户详细信息存储在每个网站集的 UIL 中。


#Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/Projects"
$UserID = "i:0#.f|membership|[email protected]"
$NewDisplayName = "Steve Johnson"

#Connect to the site
Connect-PnPOnline -Url $SiteURL -Interactive

#Get the user
$User = Get-PnPUser -Identity $UserID

#Update the display name
$User.Title = $NewDisplayName
$User.Update()
Invoke-PnPQuery

如果您想要更新本地 SharePoint 中的显示名称,请参阅本文:如何使用 PowerShell 更新 SharePoint 用户的显示名称?

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

取消回复欢迎 发表评论:

关灯