SharePoint 2013技巧分享系列 - 同步Exchange显示高清用户照片

在“SharePoint 2013技巧分享系列 - Active Directory同步显示用户照片”文中介绍了如何同步Active Directory显示用户照片,但是同步完成后,用户照片尺寸和清晰度都不是非常理想。本文将介绍如何同步Exchange Server显示高清用户照片。
原理
与SharePoint Server 2010相似, 在SharePoint Server 2013中存在一个用户照片的目录。当SharePoint启用Exchange照片同步时, SharePoint将使用Exchange Server 2013 作为照片存取目录, 而SharePoint本地照片目录将被屏蔽,也就是说,设置SharePoint-Exchange照片同步后,将不允许用户通过SharePoint修改其头像照片。在Central Administration - User Profile - Manage User Profiles中可以看到Picture属性显示“You can't change this person's photo because it is synchronized with Microsoft Exchange.".

需要注意的是,在进行同步设置时,要对Exchange Server进行简单的配置,并且需要重新启动IIS。 而在SharePoint 2013中需要配置相关权限和服务,使SharePoint 2013能够连接Exchange Server并获取用户数据。
环境实例
为了避免误解,这里我们实现定义一些环境配置,方便在详细步骤中调用:
1. SharePoint Server 2013 (http://people), 需要添加Alternate Access映射https://people. 该连接指向My Site。


2. Exchange 2013 Client Access server (FQDN) http://e15fe.test.com。
3. Exchange 2013 Mailbox server (FQDN) http://e15be.test.com。 确认测试用户帐号已经创建, 例如 kevin@test.com。 另外确认高清照片已经上传。
4. 添加DNS record, 使autodiscover.test.com指向http://e15fe.test.com。
步骤
确认以上所有配置后,我们将进行以下几个步骤的配置 。
第一步,添加Exchange 2013 Autodiscover服务,在Exchange Management Shell command中运行以下命令,
Get-ClientAccessServer | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://autodiscover.test.com/autodiscover/autodiscover.xml
第二步, SharePoint 2013 使用外部连接EWS和ECP读取Exchange 2013 用户照片数据。 现在我们需要使用Exchange Management Shell command运行,
Get-WebServicesVirtualDirectory | Set-WebServicesVirtualDirectory –InternalUrl https://e15fe.test.com/ews/exchange.asmx –ExternalUrl https://e15fe.test.com/ews/exchange.asmx
Get-EcpVirtualDirectory | Set-EcpVirtualDirectory –InternalUrl https://e15fe.test.com/ecp –ExternalUrl https://e15fe.test.com/ecp
第三步,完成以上Exchange server配置后,需要在SharePoint 2013安装Exchange Web Services Managed API v2.0,并且将Microsoft.Exchange.WebServices.dll载入到GAC中。 这一步骤我们需要使用.NET 4中的命令GacUtil,所以,在进行这一步骤前,请确认.Net 4.0 SDK已经安装在服务器上。完成安装后,在PowerShell中运行以下命令载入Microsoft.Exchange.WebServices.dll。 载入完成后,需要重新启动IIS。
Set-location "C:\Program Files\Microsoft\Exchange\Web Services\2.0"
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("c:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll")
iisreset
第四步,在SharePoint 2013中配置S2SOAuth,使用SharePoint 2013 Management Shell command运行以下命令:
New-SPTrustedSecurityTokenIssuer -name "Exchange" -MetadataEndPoint "https://email.test.com/autodiscover/metadata/json/1"
$sts=Get-SPSecurityTokenServiceConfig
$sts.HybridStsSelectionEnabled = $true
$sts.AllowMetadataOverHttp = $false
$sts.AllowOAuthOverHttp = $false
$sts.Update()
$exchange=Get-SPTrustedSecurityTokenIssuer "Exchange"
$app=Get-SPAppPrincipal -Site http://people -NameIdentifier $exchange.NameId
$site=Get-SPSite http://people
Set-SPAppPrincipalPermission -AppPrincipal $app -Site $site.RootWeb -Scope sitesubscription -Right fullcontrol -EnableAppOnlyPolicy
第五步, 在Exchange server中配置S2SOAuth,在Exchange Management Shell中运行以下命令
cd \Program Files\Microsoft\Exchange Server\V15\Scripts>
.\Configure-EnterprisePartnerApplication.ps1 -AuthMetadataUrl https://people/_layouts/15/metadata/json/1 -ApplicationType sharepoint
完成以上命令后,需要重启IIS,
iisreset e15fe
iisreset e15be
第六步,配置SharePoint 2013 和Exchange server照片同步
$wa = Get-SPWebApplication http://people
$wa.Properties["ExchangeAutodiscoverDomain"] = "email.test.com"
$wa.UserPhotoImportEnabled = $true
$wa.UserPhotoErrorExpiration = 1.0
$wa.UserPhotoExpiration = 6.0
$wa.Update()
完成以上步骤后,使用测试帐户登陆进入http://people,刷新后即可从Exchange服务器获取高清用户照片。
需要注意的是,如果仍旧显示Active Directory小照片,可以在Central Administration - User Profile Service - Manage User Properties中,编辑Picture属性,删除其中Active Directory映射的Property Mapping for Synchronization,然后”Start Full Profile Synchronization“即可。
对比显示结果:
同步前

同步后

在http://people中大照片显示对比更加明显,这里就不再上传了。
如果你有更好的建议和方法,欢迎留言讨论。
SharePoint 2013技巧分享系列 - 同步Exchange显示高清用户照片的更多相关文章
- SharePoint 2013技巧分享系列 - Active Directory同步显示用户照片
为了保持通讯信息的一致性,需要设置SharePoint,Exchange, Lync等信息同步更新显示,例如,员工头像信息. 本文介绍如何在SharePoint 2013中同步显示Active Dir ...
- SharePoint 2013技巧分享系列 - 隐藏Blog和Apps左侧导航菜单
企业内部网中,不需要员工创建Blog或者创建,安装SharePoint应用,因此需要在员工个人Web页面需要隐藏Blog或者Apps导航菜单, 其步骤设置如下: 该技巧适合SharePoint 201 ...
- SharePoint 2013 图文开发系列之入门教程
做了SharePoint有三年了,大家经常会问到,你的SharePoint是怎么学的,想想自己的水平,也不过是初级开发罢了.因为,SharePoint开发需要接触的东西太多了,Windows操作系统. ...
- SharePoint 2013 图文开发系列之列表定义高级篇
转载自 http://www.cnblogs.com/jianyus/p/3484714.html SharePoint列表库,是我们使用过程中最常用的库,下面,我们简单介绍下代码定义自定义列表,主 ...
- SharePoint 2013 图文开发系列之代码定义列表
在SharePoint的开发中,用Visual Studio自定义列表是经常会用到的,因为很多时候,我们并不会手动创建列表,而手动创建列表在测试服务器和正式机之间同步字段,也很麻烦,所以我们经常用代码 ...
- SharePoint 2013 图文开发系列之WebPart
这是我们介绍SharePoint开发入门的第一篇,在这一篇里,我们会介绍SharePoint开发的几个关键物理路径,一些开发技巧和最基础的WebPart开发. 开发工具 在SharePoint 201 ...
- SharePoint 2013 图文开发系列之事件接收器
在SharePoint的使用中,我们经常需要在完成一个动作之后,触发一个事件:比如,我们上传一个文档,但是没有标题,我们需要在上传完成之后,触发一个事件把文件名同步到标题,这就需要用到事件接收器. 此 ...
- SharePoint 2013 图文开发系列之计时器任务
SharePoint的计时器任务,又称TimerJob,由服务里的Timer服务执行,在管理中心管理,是一个类似于Windows任务计划的功能,方便定时执行一些需要的功能,以免影响服务器性能. 在Sh ...
- SharePoint 2013 图文开发系列之自定义字段
SharePoint使用的优势,就在于开箱即用.快速搭建,SharePoint自身为我们提供了很多字段类型,已经很丰富了.但是,在实际应用中,我们还需要一些功能特殊的字段,下面,我们简单介绍下字段的开 ...
随机推荐
- WebAPI生成可导入到PostMan的数据
一.前言 现在使用WebAPI来作为实现企业服务化的需求非常常见,不可否认它也是很便于使用的,基于注释可以生成对应的帮助文档(Microsoft.AspNet.WebApi.HelpPage),但是比 ...
- [ASP.NET Core] Getting Started
前言 本篇文章介绍如何快速建立一个ASP.NET Core应用程序,为自己留个纪录也希望能帮助到有需要的开发人员. ASP.NET Core官网 环境 建立一个ASP.NET Core应用程序,首先要 ...
- 《C#微信开发系列(1)-启用开发者模式》
1.0启用开发者模式 ①填写服务器配置 启用开发模式需要先成为开发者,而且编辑模式和开发模式只能选择一个(进入微信公众平台=>开发=>基本配置)就可以看到以下的界面: 点击修改配置,会出现 ...
- PHP语法
* PHP语法 * 常量与变量 * 常量 - 一旦定义并初始化后,值不会改变 * 使用const关键字 const 常量名=常量值 * define(常量名,常量值) * 变量 - "$&q ...
- Bootstrap栅格布局系统的特点
栅格布局系统的特点: (1)所有的行必须放在容器中: .container或.container-fluid (2)分为多行(row),一行中平均分为12列(col) (3)网页内容只能放在列(col ...
- 政府应急平台之GIS一张图-flex/java
开发语言是flex.java,开发平台是myeclise.eclise,后台数据库是oracel或sqlserver,开发接口是arcgis api for flex,提供以下的功能: 1.视频监控: ...
- IOS开发基础知识--碎片35
1:iOS视图控制对象生命周期 init-初始化程序 viewDidLoad-加载视图 viewWillAppear-UIViewController对象的视图即将加入窗口时调用: viewDidAp ...
- iOS 疑难杂症 — — UITableView 添加 tableFooterView 旋转屏幕后收不到点击事件!!!
声明 欢迎转载,但请保留文章原始出处:) 博客园:http://www.cnblogs.com 农民伯伯: http://over140.cnblogs.com 正文 新手的烦恼你不懂 - - ## ...
- 解决PKIX:unable to find valid certification path to requested target 的问题
这两天在twitter服务器上忽然遇到这样的异常: e: sun.security.validator.ValidatorException: PKIX path building failed: s ...
- 整型信号量和PV操作(计算机操作系统)
在整型信号量机制中,信号量被定义为一个整形变量.除初始化外,仅能通过两个标准的原子操作Wait(S)和Signal(S)来访问.其通常分别被称为P.V操作. 描述如下: P操作:S=S-1:如果S小于 ...