Script to find out if updates are installed on a number of servers
Hello Team,
I found some script which is checking if particular updates have been installed on remote servers. This script might be very helpfull but unfortunatelly it is not working. I’m the beginner and don’t know how to correct it. May I kindly ask you to help me correct it?
$computers=Get-Content .computers.txt
$Kbs=Get-Content .updates.txt
$ErrorActionPreference=“SilentlyContinue”;
ForEach ($computerin$computers) {
add-content“———————— $computer ——————————————————-“-path .hotfixes.txt
ForEach ($Kbin$Kbs) {
$Info=$null
$Info=Get-HotFix-cn$computer-ID“$Kb”
if ($Info-eq$null) {
add-content“$Kb not installed”-path .hotfixes.txt
}
else {
$InstalledDate=$Info.InstalledOn
add-content“$Kb installed $InstalledDate“-path .hotfixes.txt
}
}
}
Thank you in advance.
Hello Team, I found some script which is checking if particular updates have been installed on remote servers. This script might be very helpfull but unfortunatelly it is not working. I’m the beginner and don’t know how to correct it. May I kindly ask you to help me correct it? $computers=Get-Content .computers.txt$Kbs=Get-Content .updates.txt$ErrorActionPreference=“SilentlyContinue”;ForEach ($computerin$computers) {add-content“———————— $computer ——————————————————-“-path .hotfixes.txtForEach ($Kbin$Kbs) {$Info=$null$Info=Get-HotFix-cn$computer-ID“$Kb”if ($Info-eq$null) {add-content“$Kb not installed”-path .hotfixes.txt}else {$InstalledDate=$Info.InstalledOnadd-content“$Kb installed $InstalledDate“-path .hotfixes.txt}}} Thank you in advance. Read More