使用 PowerShell 启动 SharePoint 用户配置文件同步
如何启动SharePoint用户配置文件同步?
要手动启动用户配置文件同步,请执行以下操作:
- 转到 SharePoint 管理中心 >> 应用程序管理 >> 单击管理服务应用程序。
- 在管理服务应用程序 >> 单击 User Profile Service 应用程序的名称列
- 在“管理配置文件服务”页面 >> 在“同步”部分下,单击“启动配置文件同步”。
- 选择开始增量同步(同步自上次同步以来更改的配置文件),或选择开始完全同步以同步所有配置文件
如何更改增量同步的时间表?
默认情况下,它每天运行一次。您可以从以下位置安排用户配置文件增量同步:
使用 PowerShell 启动 SharePoint 用户配置文件同步
如果您想偶尔执行一次完全导入(例如,每周一次!),您可以在任务计划程序中计划此 PowerShell 脚本。
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Full Import Flag
$FullImport = $true
#Get User Profile Service Application
$UserProfileService = Get-SPServiceApplication | where { $_.TypeName -eq "User Profile Service Application" }
#Start Importing User Profile Sync
$UserProfileService.StartImport($FullImport)

