WSUS GET REMOTE SYSTEM INSTALLED PATCHES

GET REMOTE SYSTEM INSTALLED PATCHES

<# SRIPT STARTS HERE #>

Function exportqfe {
BEGIN {}
PROCESS {
$server = "$_"
if ($_ -ne "") {
Write-host "Exporting installed hotfix details of $server, pasting output in c:\Audit"
$QFE = Get-hotfix -computername $server | select-object -property Description,HotFixID,InstalledBy,InstalledOn | export-csv c:\$server.csv

}
}
END {}
}
cls
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path
$LogFile = $Scriptpath+"\Audit"
Get-Content $Scriptpath"\computers.txt" | exportqfe

-------------------------------------------------------------------------------------------
<# SRIPT STARTS HERE #>

function Hotfixreport {
$computers = Get-Content C:\computers.txt 
$ErrorActionPreference = 'Stop' 
ForEach ($computer in $computers) {

  try
    {
Get-HotFix -cn $computer | Select-Object PSComputerName,HotFixID,Description,InstalledBy,InstalledOn | FT -AutoSize

    }

catch

    {
Write-Warning "System Not reachable:$computer"
    }
}

}
Hotfixreport > "$env:c:\Hotfixreport.txt"

Comments

Popular posts from this blog

altiris software key

Service Principal Names (SPNs) SetSPN Syntax (Setspn.exe)

Troubleshooting Netlogon Error Codes