在 Lync Server 2013 中的两个用户之间测试 IM 的功能Testing ability to IM between two users in Lync Server 2013

 

上次修改的主题: 2014-06-05Topic Last Modified: 2014-06-05

验证计划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 的远程实例运行时,必须为用户分配具有运行 Test-CsIM 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-CsIM 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-CsIM"}

说明Description

Test-CsIM cmdlet 验证一对测试用户是否可以交换即时消息。The Test-CsIM cmdlet verifies that a pair of test users can exchange instant messages. 调用后,Test-CsIM cmdlet 将通过尝试将一对测试用户登录到 Lync Server 来启动。When called, the Test-CsIM cmdlet starts off by trying to log on a pair of test users to Lync Server. 假定两次登录成功,则 cmdlet 将在两个测试用户之间启动 IM 会话。Assuming the two logons are successful, the cmdlet then starts an IM session between the two test users. (User 1 邀请用户2到 IM 会话,而用户2接受邀请。 ) 在验证是否可以在两个用户之间交换邮件之后,Test-CsIM 将结束 IM 会话并将这两个用户从系统注销。(User 1 invites User 2 to an IM session, and User 2 accepts the invitation.) After verifying that messages can be exchanged between the two users, Test-CsIM then ends the IM session and logs both users off the system.

有关详细信息,请参阅 CsIM Cmdlet 的帮助文档。For more information, see the Help documentation for the Test-CsIM cmdlet.

运行测试Running the Test

可以使用一对预配置的测试帐户运行 Test-CsIM cmdlet (参阅设置用于运行 Lync Server 测试的测试帐户) 或已为其启用 Lync Server 的任意两个用户的帐户。The Test-CsIM cmdlet can be run using either a pair of preconfigured test accounts (see Setting Up Test Accounts for Running Lync Server Tests) or the accounts of any two users who are enabled for Lync Server. 若要使用测试帐户运行此检查,只需指定要测试的 Lync Server 池的 FQDN 即可。To run this check using test accounts, you just have to specify the FQDN of the Lync Server pool being tested. 例如:For example:

Test-CsIM -TargetFqdn "atl-cs-001.litwareinc.com"

若要使用实际用户帐户运行此检查,必须为每个帐户 (包含帐户名称和密码) 的对象创建两个 Windows PowerShell 凭据对象。To run this check using actual user accounts, you must create two Windows PowerShell credentials objects (objects that contain the account name and password) for each account. 在调用 CsIM 时,必须包括这些凭据对象和两个帐户的 SIP 地址:You must then include those credentials objects and the SIP addresses of the two accounts when you call Test-CsIM:

$credential1 = Get-Credential "litwareinc\kenmyer"
$credential2 = Get-Credential "litwareinc\davidlongmire"
Test-CsIm -TargetFqdn "atl-cs-001.litwareinc.com" -SenderSipAddress "sip:kenmyer@litwareinc.com" -SenderCredential $credential1 -ReceiverSipAddress "sip:davidlongmire@litwareinc.com" -ReceiverCredential $credential2

有关详细信息,请参阅 CsIM Cmdlet 的帮助文档。For more information, see the Help documentation for the Test-CsIM cmdlet.

确定成功或失败Determining Success or Failure

如果两个用户可以完成即时消息会话,您将收到与以下内容类似的输出,并将 Result 属性标记为 " 成功":If the two users can complete an instant messaging session, you'll receive output similar to this, with the Result property marked as Success:

TargetFqdn: atl-cs-001.litwareinc.comTargetFqdn : atl-cs-001.litwareinc.com

结果:成功Result : Success

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

误差Error :

诊断Diagnosis :

如果测试用户无法完成会话,则结果将显示为 "失败",并且会在 "错误" 和 "诊断" 属性中记录其他信息:If the test users can't complete the session, the Result will be shown as Failure, and additional information will be recorded in the Error and Diagnosis properties:

TargetFqdn: atl-cs-001.litwareinc.comTargetFqdn : atl-cs-001.litwareinc.com

结果:失败Result : Failure

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

错误:504,服务器超时Error : 504, Server time-out

诊断: ErrorCode = 2,Source = atl-cs-litwareinc,Reason = 参阅Diagnosis : ErrorCode=2, Source=atl-cs-001.litwareinc.com,Reason=See

响应代码和原因短语。response code and reason phrase.

Microsoft DiagnosticHeaderMicrosoft.Rtc.Signaling.DiagnosticHeader

例如,以前的输出表明由于找不到指定的用户而导致测试失败。For example, the previous output states that the test failed because the specified user couldn't be found. 您可以通过运行以下命令来确定 SIP 地址是否有效 (以及用户是否已为 Lync Server) 启用了该 SIP 地址:You can determine whether a SIP address is valid (and whether the user assigned that SIP address was enabled for Lync Server) by running this command:

Get-CsUser "Ken Myer" | Select-Object SipAddress, Enabled

如果 Test-CsIM 失败,则可能需要重新运行测试,这一次包括 Verbose 参数:If Test-CsIM fails, then you might want to rerun the test, this time including the Verbose parameter:

Test-CsIM -TargetFqdn "atl-cs-001.litwareinc.com" -Verbose

包含 Verbose 参数时,Test-CsIM 将返回它在检查了两个测试用户参与 IM 会话的能力时所尝试的每个操作的分步帐户。When the Verbose parameter is included, Test-CsIM will return a step-by-step account of each action it tried when it checked the ability of the two test users to take part in an IM session. 例如,以下是当一组错误的用户凭据 (在这种情况下,在为 CsIM 提供不正确的密码) 的情况下会发生的示例输出:For example, here’s sample output that occurs when an incorrect set of user credentials (in this case, an incorrect password) is supplied to Test-CsIM:

发送注册请求:Sending Registration request :

目标 Fqdn = atl-cs-011.litwareinc.comTarget Fqdn = atl-cs-011.litwareinc.com

用户 Sip 地址 = sip:kenmyer@litwareinc.comUser Sip Address = sip:kenmyer@litwareinc.com

注册器端口 = 5061Registrar Port = 5061

已选择身份验证类型 "IWA"。Auth Type 'IWA' is selected.

针对 sip/atl-001-litwareinc 的注册命中率Registration hit against sip/atl-cs-001.litwareinc.com

"Register" 活动在 "0.0601795" 秒内完成。'Register' activity completed in '0.0601795' secs.

"登录被拒绝" 异常。An exception 'The log on was denied. 检查是否正在使用正确的凭据,以及帐户是否处于活动状态。Check that the correct credentials are being used and the account is active.' 在工作流过程中发生。occurred during the Workflow.

测试可能失败的原因Reasons Why the Test Might Have Failed

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

  • 您指定的用户帐户无效。You specified a user account that is not valid. 您可以通过运行与以下内容类似的命令来验证用户帐户是否存在:You can verify that a user account exists by running a command similar to this:

    Get-CsUser "sip:kenmyer@litwareinc.com"
    
  • 用户帐户有效,但当前未对 Lync Server 启用该帐户。The user account is valid, but the account is currently not enabled for Lync Server. 若要验证是否已为 Lync Server 启用用户帐户,请运行与以下内容类似的命令:To verify that a user account is enabled for Lync Server, run a command similar to the following:

    Get-CsUser "sip:kenmyer@litwareinc.com" | Select-Object Enabled
    

    如果 Enabled 属性设置为 False,则表示当前未对 Lync Server 启用用户。If the Enabled property is set to False that means that the user is currently not enabled for Lync Server.

  • 即时消息服务可能不可用。The instant messaging service might not be available. 使用 Lync Server,可以配置系统,以便在无法访问存档数据库时 IM 不可用。With Lync Server, you can configure the system so that IM is not available if the archiving database cannot be accessed. 您可以通过运行与以下内容类似的命令来验证这一点:You can verify that by running a command similar to the following:

    Get-CsArchivingConfiguration -Identity "atl-cs-001.litwareinc.com" | Select-Object BlockOnArchiveFailure
    

    如果将 BlockOnArchiveFailure 设置为 True,则应确定存档数据库是否可用。If BlockOnArchiveFailure is set to True, then you should determine whether or not the archiving database is available. 您可以使用以下命令返回存档数据库的位置:You can return the locations of your archiving databases by using the following command:

    Get-CsService -ArchivingDatabase
    
  • 存档服务器可能不可用。The Archiving server might not be available. 您可以使用以下命令检索存档服务器的 FQDN:You can retrieve the FQDN of your Archiving servers by using this command:

    Get-CsService -ArchivingServer
    

    然后,可以 ping 相应的服务器以验证其是否可用。You can then ping the appropriate server to verify that it is available. 例如:For example:

    ping atl-archiving-001.litwareinc.com