I was executing below script to obtain the server patch version of Skype for business servers.
I need the output as server patch name, version and computername.
$x = Get-Content "E:\temp\servers.txt"
foreach ($y in $x)
{
Invoke-Command -ComputerName $y -scriptblock {Get-WmiObject -query ‘select name, version from win32_product’ | where {$_.name -like “*Skype for Business server 2015, core*”}} | Select-object name, Version, @{Name='ComputerName';Expression={$y}} | ft -AutoSize
}
But I am receiving output as below
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
I don't need my header tiles in every line of output. Any suggestions?
Get-WmiObject
has its own-ComputerName
Parameter. Also, what you need to do is expand the property. Just gonna be a little trickier to output – Abraham Zinala