Monitoring Server

Powershell Commands to Test Lync and Skype for Business Services

Posted on Actualizado enn

Este articulo en Español  aquí

After a few weeks without writing today I have been encouraged again, I have many “articles” in my mind, but I am more involved in some new project. This time I bring some PowerShell commands that you can launch tests of installed services in a Skype for Business implementation.

Usually when we do a Unified Communications installation there is a moment during the project where we will do a “battery” of tests to check the services of Skype for Business. This complicates sometimes, because we will need at least 2 or 3 Skype clients with different user accounts to do the “typical” IM tests, calls, conferences, etc … Apart from The complication to have the “clients” Skype simultaneously, we will need the help of another coworker to be able to do the tests.

Well, with these commands that I will specify below, we will be able to do a basic tests of the Skype services that will give us the “health” result of the platform.

To perform the tests we will need two accounts registered in Skype for Business, I always advise to have a couple of “Test” accounts, which we can have to do tests, etc. This is something we will ask in the Initial Requirements to begin the installation To our client or the Active Directory administrators. In this case the accounts that I am going to use are.

Login: MRLYNC\SkypeTest1
Sip: SkypeTest1@mrlync.com
Password: *********

Login: MRLYNC\SkypeTest2
Sip: SkypeTest1@mrlync.com
Password: *********

Once we have the data of our “Test” accounts, we will enable them in our Skype for Business.

Declare the variables

The first thing we will do is declare your variables with the data we want to use for the tests:

$login1 = “SkypeTest1@mrlync.com
$sip1 = “SkypeTest1@mrlync.com
$password1 = “*****” | ConvertTo-SecureString -AsPlainText -Force
$cred1 = New-Object System.Management.Automation.PsCredential($login1, $password1)

$login2 = “SkypeTest2@mrlync.com
$sip2 = “SkypeTest2@mrlync.com
$password2 = “******” | ConvertTo-SecureString -AsPlainText -Force
$cred2 = New-Object System.Management.Automation.PsCredential($login2, $password2)

$targetfqdn = “skypepool.mrlync.com
$authtype = “ClientCertificate”
#$authtype = “Negotiate”

Surely you have noticed that the field “login” we declare it as the field “Sip”, with Skype for Business I worked in this way the commands, but if we are going to run the tests in a platform of Lync 2013, surely we will need to put The login field: “MRLYNC \ SkypeTest1”

capture1

Front End Services

Once we have collected the data in the variables, we use the following commands to test the services of our Pool or Standard Front End Server.

#Regitration

Write-Host “Registration

Test-CsRegistration -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -UserSipAddress $sip1 -UserCredential:$cred1

capture2
Script Registration Result

#Address Book Service

Write-Host “Address Book Service

Test-CsAddressBookService -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -UserSipAddress $sip1 -UserCredential:$cred1

capture3
Script Address Book Service

#Lis Configuration

Write-Host “Lis Configuration

Test-CsLisConfiguration -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -UserSipAddress $sip1 -UserCredential:$cred1

capture4
Script Lis Result

#Presence

Write-HostPresence

Test-CsPresence -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -SubscriberSipAddress “sip:$sip1” -SubscriberCredential $cred1 -PublisherSipAddress “sip:$sip2” -PublisherCredential $cred2

capture5
Presence

 #Lync Web App

Write-Host “Skype Web App

Test-CsUcwaConference -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -OrganizerSipAddress “sip:$sip1” -OrganizerCredential $cred1 -ParticipantSipAddress “sip:$sip2” -ParticipantCredential $cred2 -verbose

capture6
Skype Web App 01
capture7
Skype Web App 02
capture8
Skype Web App 03
capture9
Skype Web App 04

 

capture10
Skype Web App 05

#Skype IM

Write-Host “Skype IM

Test-CsIm -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -SenderSipAddress “sip:$login1” -SenderCredential $cred1 -ReceiverSipAddress “sip:$login2” -ReceiverCredential $cred2
Test-CsGroupIM -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -SenderSipAddress “sip:$sip1” -SenderCredential $cred1 -ReceiverSipAddress “sip:$sip2” -ReceiverCredential $cred2
Test-CsMcxP2PIM -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -SenderSipAddress “sip:$sip1” -SenderCredential $cred1 -ReceiverSipAddress “sip:$sip2” -ReceiverCredential $cred2

capture11
Script Skype IM

#VoIP

Write-Host “VoIP”

Test-CsP2PAv -authentication $authtype -TargetFqdn $targetfqdn -RegistrarPort 5061 -SenderSipAddress “sip:$sip1” -SenderCredential $cred1 -ReceiverSipAddress “sip:$sip2” -ReceiverCredential $cred2

capture12
VoIP

All of these commands can be added in a TxT file format * .ps1 and launched directly as a script from PowerShell, so we can use it to test the Skype deployments that we will configure

InstallDatabase Skype Monitoring “failed with the operating system error 5(Access is denied.)”

Posted on Actualizado enn

Skype for Business Monitoring  Server “failed with the operating system error 5(Access is denied.)”

Normalmente en la instalaciones de Lync o Skype for Business es el propio cliente el que suele aprovisionarnos de una instancia SQL a la que haremos referencia para instalar nuestras BBDD de Back End o  en este caso una instancia para instalar las BBDD de Monitoring Server donde nuestro Front End registra los datos necesarios para luego a través de Reporting Service poder consultarlos.

Pero no siempre es así, y muchas veces nos tenemos que enfrentar a instalar nosotros mismos un SQL Server, instancias, Reporting, etc ..  Al final como en muchas otras cosas, uno aprende a base de experiencia y de encontrarse errores y problemas. Para ello, yo siempre aconsejo hacer pruebas en nuestro laboratorio, para poder enfrentarnos a la instalación en el cliente con cierta seguridad. En este articulo, contare uno de esos casos que me encontré.

La BBDD de Monitoring la íbamos a instalar en una instancia de un servidor SQL remoto, creo que era la tercera vez que iba a instalar un servidor SQL, monte la instancia, configure el Reporting Service y comprobe que podía acceder sin problemas SQL Server Management Studio con el usuario Administrador de Skype.

El siguiente paso, asociar la nueva instancia SQL como Monitoring del Front End desde la topología.

Capturetopo

Hasta aquí todo correcto, pero una vez publicada la topología, lance el siguiente comando para instalar las BBDD en el servidor SQL del Monitoring.

Install-CsDatabase -ConfiguredDatabases -SqlServerFqdn cvtsql01.xxxxxx.com

Apareció el siguiente error

Capture_error

Error. “Directory lookup for the file “x”   filed with the operating system error 5(Access is denied.)”

En este caso el problema era que el servicio en el servidor SQL de la instancia “Monitor” estaba corriendo con la cuenta “NT Service” que por defecto al crear la instancia estaba así.

Service01.

Al cambiarla a “local system account” y hacer un “restart” del servicio puede crear de forma correcta las BBDD desde el Servidor Front End

Service02..JPG

Como conclusión a la hora de implementar la monitorización en la infraestructura de Skype o Lync hay que tener en cuenta las cuentas con las que ejecutamos los servicios de las BBDD, como dije al principio no soy experto en SQL pero de esta manera conseguí solventar este problema, y de momento tras actualizaciones, reinicios, etc… parece que el servicio esta aguantando y no da problemas

Saludos!