Lync Server Component Version using PowerShell (WMI Classes)

Every Lync Server administrator must have this Cmdlet, which shows each Lync Server 2010/2013 Component’s version:

Get-WmiObject -class Win32_Product | where {$_.name -like “*Lync Server*”} | Sort-Object Name | Select Name, Version |ft -AutoSize

The result will be like this:

lynccomponentversion01

Or in Lync Server 2010:

lynccomponentversion02

To save the result in a file just add “>> C:\Lync_component-version.txt” (Use a path where you have write permissions):

Get-WmiObject -query ‘select * from win32_product’ | where {$_.name -like “*Lync Server*”} | Select Name, Version |ft -AutoSize >> C:\Lync_component-version.txt

If Windows buffer isn’t enough we get this:

lynccomponentversion03

To fix this, run the following in PowerShell:

$pshost = get-host
$pswindow = $pshost.ui.rawui

$newsize = $pswindow.buffersize
$newsize.height = 3000
$newsize.width = 100
$pswindow.buffersize = $newsize

$newsize = $pswindow.windowsize
$newsize.height = 50
$newsize.width = 100
$pswindow.windowsize = $newsize

Or we can change the PowerShell settings in “Properties->Layout”:

lynccomponentversion04

lynccomponentversion05

Please check on PowerShell window/buffer resizing in the following article:

How Can I Expand the Width of the Windows PowerShell Console?