Odpowiedzi:
Niedawno napisałem na blogu o tym problemie i wymyśliłem ten skrypt. Możesz uruchomić go jako administrator na obu komputerach lub użyć -Credential
opcji w get-hotfix
poleceniach.
$server1 = Read-Host "Server 1"
$server2 = Read-Host "Server 2"
$server1Patches = get-hotfix -computer $server1 | Where-Object {$_.HotFixID -ne "File 1"}
$server2Patches = get-hotfix -computer $server2 | Where-Object {$_.HotFixID -ne "File 1"}
Compare-Object ($server1Patches) ($server2Patches) -Property HotFixID
clear-host
$machine1=Read-Host "Enter Machine Name 1:-"
$machine2=Read-Host "Enter Machine Name 2:-"
$machinesone=@(Get-wmiobject -computername $machine1 -Credential Domain\Adminaccount -query 'select hotfixid from Win32_quickfixengineering')
$machinestwo=@(Get-WmiObject -computername $machine2 -Credential Domain\Adminaccount -query 'select hotfixid from Win32_quickfixengineering')
Compare-Object -RefernceObject $machinesone -DiffernceObject $machinestwo -Property hotfixid