Lync PowerShell Script Repository | Lync Up

Lync PowerShell Script Repository
This Page Contains a list of Scripts and one-liners for Lync. Some are mine, the rest have the source credited. If you have something useful to add please feel free to send it to me and I’ll add it to the list. If, for whatever reason, you don’t want your script listed here, let me know and I will remove it.

Note: I have not tested these scripts, and do not take responsibility for them, always test and use at your own risk.

Name

Description

Source

Download

Update-Snom300Firmware.ps1

Update a Snom 300 phone’s firmware using HTTP Post, more details here

Tom Arbuthnot

Download

Reboot-SnomM9_0.2.ps1

Uses HTTP Post to log into and reboot a series of Snom M9 phones from a CSV containing IP addresses. Used due to a memory leak on the M9 firmware

Tom Arbuthnot

Download

Get-CsUserConnectionInfo.ps1

Function to find out which servers the user is associated with and the preferred order that the user will connect to them. More here

Pat Richard

Download

Set-Lync2010Features.ps1

Automated Server prereq’s PowerShell script for Lync Server 2010

Ståle Hansen
Pat Richard
Marjus Sirvinsks

Download

Get-CsConnections.ps1

See user connections, client versions, load balancing in Lync 2010

Pat Richard

Download

Lync PowerShell One-liners

You can do a surprising amount in PowerShell with one line. Even if you can’t find exactly what you are looking for. Also I’ve been a bit liberal with “one-liner”, it’s really anything short enough to fit in the text box.

Command

Description

Source

(get-csuser -OnLyncServer -Filter {EnterpriseVoiceEnabled -eq $true}).count

Count the Number of Voice Enabled Lync Users in a Lync Deployment

VoIPNorm

$photo = [byte[]](Get-Content C:\rhouston.jpg -Encoding byte)
Set-ADUser rhouston -Replace @{thumbnailPhoto=$photo}

This example uses AD PowerShell to import a photo named rhouston.jpg for a user named rhouston

Mike Pfieffer

Get-CsAdUser | ?{$_.UserAccountControl -match “AccountDisabled” -and $_.Enabled -eq $true} | ft Name,Enabled,SipAddress -auto

Finds AD disabled accounts who are still Lync enabled

Pat Richard

Get-CsAdUser | ?{$_.UserAccountControl -match “AccountDisabled” -and $_.Enabled -eq$true} | Disable-CsUser

Disable Users for Lync who are already disabled in AD

Pat Richard

Set-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0” -Name “NtlmMinClientSec” –Value 0

Set-ItemProperty “HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0” -Name “NtlmMinServerSec” -Value 0

Set NTLM Security to No Minimum

Pat Richard

Import-Module ServerManager
Add-Windowsfeature PowerShell-ISE

Add the PowerShell ISE to Server 2008 R2

Tom Arbuthnot