Lync Server Component Version using PowerShell (WMI Classes)

Every Lync Server administrator must have this PowerShell 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:

[code language=”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
[/code]

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?