SharePoint 2013技巧分享系列 - Active Directory同步显示用户照片

为了保持通信信息的一致性,须要设置SharePoint,Exchange, Lync等信息同步更新显示,例如,员工头像信息。 本文介绍如何在SharePoint 2013中同步显示Active Directory活动目录用户头像信息。服务器

首先在用户属性Picture中导入AD活动目录属性,进入“Central Administration” -〉“Manage Service Applications”-〉“User Profile Service Application” -〉“Manage User Properties” -〉“Picture”工具

 

点击“Edit”,编辑Picture属性,spa

 

添加thumbnailPhoto属性到Picture中,3d

添加成功后,该属性会显示以下:code

点击“OK”,确认保存。blog

 

退出用户属性编辑页面,进入User Profile主页面“Central Administration” -〉“Manage Service Applications”-〉“User Profile Service Application”,开发

点击“Start Profile Synchronization”,同步AD活动目录用户配置信息。该步骤会根据用户的数量决定运行时间长短,须要耐心等待。get

同步完成后,须要运行如下PowerShell命令更新用户信息:同步

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/Peopleit

运行完成后,刷新用户配置页面,便可看到同步后的用户照片。

 

须要注意的是,若是用户照片仍旧没法在SharePoint中显示,须要查看AD的thumbnailPhoto属性是否为空。这里推荐一个免费工具能够快捷查看AD属性,ADExplorer

运行ADExplorer后,按照如下条件查找

 

点击查找结果,在主显示页面会显示AD属性thumbnailPhoto,若是有数字显示则不为空,不然为空。

 

若是须要添加用户照片到AD活动目录,能够在AD服务器上运行如下PS代码,在运行前,须要确认照片已经存在,

$userName = “kevinfan”
$filePath = “c:\temp\kevinf.jpg”
[byte[]]$img = Get-Content $filePath –encoding byte
Get-ADUser –filter {samaccountname –eq $userName} |
Set-ADUser –replace @{thumbnailphoto=$img}

 

欢迎留言分享你的SharePoint 2013开发和设置技巧。

相关文章
相关标签/搜索