One of the advancements in Lync over the previous Microsoft OCS product is the use of Powershell as the basis for configuration and administration. Microsoft has included a number of synthetic transactions cmdlets that can be used to test that Lync is functioning correctly.
To see the full list of test cmdlets available, get-command test-cs
Test-CsAddressBookService |
Test-CsAddressBookWebQuery |
Test-CsAVConference |
Test-CsCertificateConfiguration |
Test-CsClientAuth |
Test-CsComputer |
Test-CsDialInConferencing |
Test-CsDialPlan |
Test-CsFederatedPartner |
Test-CsGroupExpansion |
Test-CsGroupIM |
Test-CsIM |
Test-CsKerberosAccountAssignment |
Test-CsLisCivicAddress |
Test-CsLisConfiguration |
Test-CsLocationPolicy |
Test-CsOUPermission |
Test-CsP2PAV |
Test-CsPhoneBootstrap |
Test-CsPresence |
Test-CsPstnOutboundCall |
Test-CsPstnPeerToPeerCall |
Test-CsRegistration |
Test-CsSetupPermission |
Test-CsTopology |
Test-CsTrunkConfiguration |
Test-CsVoiceNormalizationRule |
Test-CsVoicePolicy |
Test-CsVoiceRoute |
Test-CsVoiceTestConfiguration |
Test-CsVoiceUser |
Test-CsWebApp |
Test-CsWebAppAnonymous |
Most of these cmdlets require one or two SIP registered users to be provided as parameters. To set up the test users and register them as health registrars, the guys at Technet have published a script to create the required users and register them with Lync as test accounts and Registrars for health monitoring.
A simple test of IM can be run with Test-CSIm poolFQDN
Test-CSIm lync.contoso.com
TargetFqdn : lync.contoso.com Result : Success Latency : 00:00:02.5953597 Error : Diagnosis : |
The individual tests can be scripted, scheduled and the results entered into the Event Log or sent to an administrator in an email.
To collect the result and print it to the screen –
$Test_result = test-csim lync.contoso.com $Test_result |
To just access the Result property, use $Test_result.result which should print out Success or the result can be checked and an appropriate alert generated
$Test_result = test-csim lync.contoso.com $a = Test_result.TargetFQDN+ " "+Test_result.error if ($Test_result.Result -eq "Success") { "IM Working" write-eventlog -logname Application -source LyncTestApp -eventID 3000 -entrytype Information -message "LyncTestApp no problem detected." } Else { "IM Failed" write-eventlog -logname Application -source LyncTestApp -eventID 3001 -entrytype Information -message "LyncTestApp detected a problem. $a" } |
Note: First you must register your app with new-eventlog -LogName Application -Source LyncTestApp |
No comments:
Post a Comment