$KB = Read-Host -Prompt "Enter KB number: "
$computername = Read-Host -Prompt "Enter FQDN of Computer or IP"
$query = "select HotFixID from Win32_QuickFixEngineering"
$HotFixes = Get-WmiObject -Query $query -ComputerName $computername
$found = $false
foreach ($HotFix in $HotFixes)
{
#Write-Host $HotFix.HotFixID
if ($HotFix.HotFixID -eq $KB)
{
Write-Host "HotFix $KB installed"
$found = $true
}
}
if ($found -eq $false)
{
Write-Host "HotFix not found"
}
Clear-Variable $HotFixes
Thursday, October 13, 2016
Check for a hotfix on a remote Windows Server with WMI
Subscribe to:
Posts (Atom)