在 Lync Server 2013 中测试持久聊天Testing persistent chat in Lync Server 2013

 

上次修改的主题: 2014-11-03Topic Last Modified: 2014-11-03

验证计划Verification schedule

每天Daily

测试工具Testing tool

Windows PowerShellWindows PowerShell

所需的权限Permissions required

在使用 Lync Server 命令行管理程序本地运行时,用户必须是 RTCUniversalServerAdmins 安全组的成员。When run locally using the Lync Server Management Shell, users must be members of the RTCUniversalServerAdmins security group.

使用 Windows PowerShell 的远程实例运行时,必须为用户分配具有运行 CsPersistentChatMessage cmdlet 的权限的 RBAC 角色。When run using a remote instance of Windows PowerShell, users must be assigned an RBAC role that has permission to run the Test-CsPersistentChatMessage cmdlet. 若要查看可使用此 cmdlet 的所有 RBAC 角色的列表,请从 Windows PowerShell 提示符处运行以下命令:To see a list of all RBAC roles that can use this cmdlet, run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets -match "Test-CsPersistentChatMessage"}

说明Description

CsPersistentChatMessage cmdlet 验证一对测试用户是否可以使用持久聊天服务交换邮件。The Test-CsPersistentChatMessage cmdlet verifies that a pair of test users can exchange messages using the Persistent Chat service. 为执行此操作,cmdlet 会将两个用户记录到 Lync Server 2013,将用户连接到持久聊天室,交换一对消息,然后退出聊天室并注销两个用户。To do this, the cmdlet logs the two users on to Lync Server 2013, connects the users to a persistent Chat room, exchanges a pair of messages, then exits the chat room and logs off the two users. 请注意,如果您没有创建任何聊天室,或者没有为两个测试用户帐户分配可访问持久聊天服务的持久聊天策略,则调用此 cmdlet 将会失败。Note that calls to this cmdlet will fail if you have not created any chat rooms or if the two test user accounts are not assigned a Persistent Chat policy that gives them access to the Persistent Chat service.

运行测试Running the test

下面的示例中所示的命令测试一对用户 (litwareinc \ pilar and litwareinc \ kenmyer) 登录到 Lync Server 2013,然后使用持久聊天服务交换邮件的功能。The commands shown in the following example test the ability of a pair of users (litwareinc\pilar and litwareinc\kenmyer) to log on to Lync Server 2013 and then exchange messages using the Persistent Chat service. 为执行此操作,示例中的第一个命令使用 Get-Credential Cmdlet 创建 Windows PowerShell 命令行接口 Credential 对象,该对象包含用户 Pilar Ackerman 的名称和密码。To do this, the first command in the example uses the Get-Credential cmdlet to create a Windows PowerShell command-line interface credential object that contains the name and password of the user Pilar Ackerman. (因为登录名 litwareinc \ pilar 包含为参数,所以 "Windows PowerShell 凭据请求" 对话框仅要求管理员输入 Pilar Ackerman 帐户的密码。 ) 生成的凭据对象将存储在名为 $cred 1 的变量中。(Because the logon name, litwareinc\pilar, was included as a parameter, the Windows PowerShell Credential Request dialog box only requires the administrator to enter the password for the Pilar Ackerman account.) The resulting credentials object is then stored in a variable named $cred1. 第二个命令执行相同的操作,但这次返回的是 Ken Myer 帐户的凭据对象。The second command does the same thing, this time returning a credential object for the Ken Myer account.

使用 credential 对象时,第三个命令将确定这两个用户是否可以使用持久聊天登录 Lync Server 2013 和 exchange 邮件。With the credential objects in hand, the third command determines whether these two users can log on to Lync Server 2013 and exchange messages using Persistent Chat. 若要执行此任务,请使用以下参数调用 CsPersistentChatMessage Cmdlet: TargetFqdn (注册器池的 FQDN) ;SenderSipAddress (第一个测试用户) 的 SIP 地址;SenderCredential (包含此同一用户的凭据的 Windows PowerShell 对象) ;ReceiverSipAddress (其他测试用户) 的 SIP 地址;和 ReceiverCredential (Windows PowerShell 对象,其中包含其他测试用户) 的凭据。To perform this task, the Test-CsPersistentChatMessage cmdlet is called using the following parameters: TargetFqdn (the FQDN of the Registrar pool); SenderSipAddress (the SIP address for the first test user); SenderCredential (the Windows PowerShell object that contains the credentials for this same user); ReceiverSipAddress (the SIP address for the other test user); and ReceiverCredential (the Windows PowerShell object that contains the credentials for the other test user).

$cred1 = Get-Credential "litwareinc\pilar"
$cred2 = Get-Credential "litwareinc\kenmyer"

Test-CsPersistentChatMessage -TargetFqdn atl-persistentchat-001.litwareinc.com -SenderSipAddress "sip:pilar@litwareinc.com" -SenderCredential $cred1 -ReceiverSipAddress "sip:kenmyer@litwareinc.com" -ReceiverCredential $cred2

确定成功或失败Determining success or failure

如果指定用户具有有效的位置策略,则将接收与以下内容类似的输出,并将 Result 属性标记为 " 成功":If the specified user has a valid location policy, then you'll receive output similar to this, with the Result property marked as Success:

目标 Fqdn: atl-cs-001.litwareinc.comTarget Fqdn : atl-cs-001.litwareinc.com

结果:成功Result : Success

延迟:00:00:00Latency : 00:00:00

错误消息:Error Message :

诊断Diagnosis :

如果指定用户无法使用持久聊天服务交换邮件,则结果将显示为 " 失败",并且会在 "错误" 和 "诊断" 属性中记录其他信息:If the specified users can't exchange messages using the Persistent Chat service, the Result will be shown as Failure, and additional information will be recorded in the Error and Diagnosis properties:

警告:无法读取给定的完全限定的注册器端口号WARNING: Failed to read Registrar port number for the given fully qualified

(FQDN) 的域名称。domain name (FQDN). 使用默认注册器端口号。Using default Registrar port number. 异常Exception:

InvalidOperationException:在拓扑中找不到匹配的群集。System.InvalidOperationException: No matching cluster found in topology.

at

TryRetri 的 SipSyntheticTransaction。 SyntheticTransactionsMicrosoft.Rtc.Management.SyntheticTransactions.SipSyntheticTransaction.TryRetri

eveRegistrarPortFromTopology (Int32& registrarPortNumber) eveRegistrarPortFromTopology(Int32& registrarPortNumber)

目标 Fqdn: atl-cs-001.litwareinc.comTarget Fqdn : atl-cs-001.litwareinc.com

结果:失败Result : Failure

延迟:00:00:00Latency : 00:00:00

错误消息:10060,连接尝试失败,因为连接方Error Message : 10060, A connection attempt failed because the connected party

在一段时间后未正确响应,或者did not properly respond after a period of time, or

已建立连接失败,因为连接的主机具有established connection failed because connected host has

无法响应 [ 2001:4898: e8: f39e:5c9a: ad83:81b3: 9944 ] :5061failed to respond [2001:4898:e8:f39e:5c9a:ad83:81b3:9944]:5061

内部异常:连接尝试失败,因为Inner Exception:A connection attempt failed because the

连接方在一段时间后未正确响应connected party did not properly respond after a period of

时间,或已建立的连接失败,因为连接的主机time, or established connection failed because connected host

未能响应has failed to respond

[2001:4898: e8: f39e:5c9a: ad83:81b3: 9944 ] :5061[2001:4898:e8:f39e:5c9a:ad83:81b3:9944]:5061

诊断Diagnosis :

测试可能失败的原因Reasons why the test might have failed

以下是 测试 CsPersistentChatMessage 可能失败的一些常见原因:Here are some common reasons why Test-CsPersistentChatMessage might fail:

  • 提供的参数值不正确。An incorrect parameter value was supplied. 所需的测试帐户可能不存在或已正确创建。The required test accounts may not exist or have been correctly created.

  • 可能存在导致测试超时的意外延迟的网络问题。There may have been a network issue causing an unexpected delay which timed out the test.