0

I have a list of machines, some machines throw

System.Runtime.InteropServices.Marshal.ThrowExceptionForHR

upon doing Windows Management Object's query,

select Name, State, Started, Status from Win32_Service

I suspect it is due to different KB installations on those machines. Is there any way to create a profile of that and compare KB updates of 2 given machines?

1 Answers1

0

You can save the output of all computername to a text file, then use PowerShell to generate list of hotfixes

$list = Get-Content <path to text file>

foreach ($cn in $list) {

$res = Get-Hotfix –cn $cn | Select HotfixID, Description, InstalledOn | `
sort InstalledOn

$res | Out-file $cn.txt
}

Then compare text file.

cuonglm
  • 2,346
  • 2
  • 15
  • 20