PowerShell

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

Comandos Powershell para probar los servicios de Lync/Skype for Business

Posted on Actualizado enn

This article in English here

Tras unas semanas sin escribir hoy me he animado de nuevo, tengo muchos “artículos” en la recamara, pero la verdad que últimamente ando mas liado en algún proyecto nuevo. En esta ocasión traigo algunos comandos PowerShell con los que se pueden lanzar pruebas de los servicios instalados en una implementación de Skype for Business.

Normalmente cuando hacemos una instalación de Comunicaciones Unificadas hay un momento durante el proyecto donde haremos una “batería” de pruebas donde comprobar los servicios de Skype for Business. Esto se complica a veces, ¿por que?, pues principalmente se complica porque necesitaremos al menos 2 o 3 clientes Skype con diferentes cuentas de usuario para hacer las “típicas” pruebas de IM, llamadas, conferencias, etc… A parte de la complicación para tener los “clientes” Skype simultáneamente, necesitaremos la ayuda de otro compañero para poder hacer las pruebas.

Pues bien, con estos comandos que paso a especificar a continuación, podremos hacer una pruebas básicas de los servicios de Skype que nos dará el resultado de “salud” de la plataforma que estamos montando.

Para realizar las pruebas necesitaremos dos cuentas dadas de alta en Skype for Business, yo siempre aconsejo tener un par de cuentas “Test”, que podremos tener para hacer pruebas, etc.. Esto es algo que pediremos en los Requisitos iniciales para comenzar la instalación a  nuestro cliente o los administradores del Directorio Activo. En este caso las cuentas que voy a utilizar son

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

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

Una vez tengamos los datos de nuestras cuentas “Test”, las habilitaremos en nuestro Skype for Business.

Declaramos las variables

Lo primero que haremos será declarar nuestras variables con los datos que queremos usar para las pruebas:

$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”

Seguramente os habréis fijado en que el campo “login” lo declaramos igual que el campo “Sip“, con Skype for Business me funcionaron de esta manera los comandos, pero si vamos a ejecutar las pruebas en una plataforma de Lync 2013, seguramente necesitaremos poner el campo login: “MRLYNC\SkypeTest1

capture1

Servicios del Front End Server

Una vez hemos recogido los datos en las variable, usaremos los siguientes comandos para probar los servicios de nuestro Pool o Servidor Front End Estándar.

#Regitration

Write-Host “Registration

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

capture2
Resultado Script Registration

 

#Address Book Service

Write-Host “Address Book Service

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

capture3
Resultado Script Address Book Service

 

#Lis Configuration

Write-Host “Lis Configuration

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

capture4
Resultado Script Lis

 

#Presence

Write-HostPresence

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

capture5
Resultado Script 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
Resultado Skype Web App 01
capture7
Resultado Skype Web App 02
capture8
Resultado Skype Web App 03
capture9
Resultado Skype Web App 04

 

capture10
Resultado 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
Resultado VoIP

Todos Estos comandos los podemos añadir en un fichero TxT con formato *.ps1 y lanzarlo directamente como un Script desde PowerShell, así lo podremos usar para probar las implantaciones de Skype que vayamos a configurar