total123
asked on
getting status of windows updates onto a readable document
client would like to know what updaes are installed on a windows 2008 server and would like to run there own report every 3 months.
Easy I thought, this command works treat, but does not display status, e.g. successful or failed. Anybody know the command for getting status as well ?
run from command prompt on windows 2008
wmic qfe list brief /format:texttablewsys > "%USERPROFILE%\hotfix.txt"
Easy I thought, this command works treat, but does not display status, e.g. successful or failed. Anybody know the command for getting status as well ?
run from command prompt on windows 2008
wmic qfe list brief /format:texttablewsys > "%USERPROFILE%\hotfix.txt"
ASKER
thanks, when i run get-windowsupdate, even with all the text, i get
The term 'get-windowsupdate' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ get-windowsupdate <<<<
+ CategoryInfo : ObjectNotFound: (get-windowsupdate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The term 'get-windowsupdate' is not recognized as the name of a cmdlet, function, script file, or operable program. Che
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ get-windowsupdate <<<<
+ CategoryInfo : ObjectNotFound: (get-windowsupdate:String)
+ FullyQualifiedErrorId : CommandNotFoundException
Is it windows server 2008 or 2008R2?
If it's 2008
If it's 2008
Function Get-MSHotfix
{
$outputs = Invoke-Expression "wmic qfe list"
$outputs = $outputs[1..($outputs.length)]
foreach ($output in $Outputs) {
if ($output) {
$output = $output -replace 'Security Update','Security-Update'
$output = $output -replace 'NT AUTHORITY','NT-AUTHORITY'
$output = $output -replace '\s+',' '
$parts = $output -split ' '
if ($parts[5] -like "*/*/*") {
$Dateis = [datetime]::ParseExact($parts[5], '%M/%d/yyyy',[Globalization.cultureinfo]::GetCultureInfo("en-US").DateTimeFormat)
} else {
$Dateis = get-date([DateTime][Convert]::ToInt64("$parts[5]", 16)) -Format '%M/%d/yyyy'
}
New-Object -Type PSObject -Property @{
KBArticle = [string]$parts[0]
Computername = [string]$parts[1]
Description = [string]$parts[2]
FixComments = [string]$parts[6]
HotFixID = [string]$parts[3]
InstalledOn = Get-Date($Dateis)-format "dddd d MMMM yyyy"
InstalledBy = [string]$parts[4]
InstallDate = [string]$parts[7]
Name = [string]$parts[8]
ServicePackInEffect = [string]$parts[9]
Status = [string]$parts[10]
}
}
}
}
ASKER
its 2008 r2
If it helps I just sourced this for you, 2008 r2 is supported for this script
Generate a Report for installed Hotfix-Update-ServicePack for Bulk Servers
[Version 3-04.08.14] Run that Script.
You will get a report(txt) for installed Hotfix for bulk Computers and get an additional txt output for unreachable computers.
Getting the Full Scripts you have to download the ZIP file.
https://gallery.technet.microsoft.com/scriptcenter/Generate-a-Report-for-f71a6800
Generate a Report for installed Hotfix-Update-ServicePack for Bulk Servers
[Version 3-04.08.14] Run that Script.
You will get a report(txt) for installed Hotfix for bulk Computers and get an additional txt output for unreachable computers.
Getting the Full Scripts you have to download the ZIP file.
https://gallery.technet.microsoft.com/scriptcenter/Generate-a-Report-for-f71a6800
ASKER
thanks merete
I did see this a few days ago and ran it. I've gone through the powershell and cannot see where it outputs to. I'm not a powershell expert. Any advice on what to do to get it to output to a file name / location ?
I did see this a few days ago and ran it. I've gone through the powershell and cannot see where it outputs to. I'm not a powershell expert. Any advice on what to do to get it to output to a file name / location ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your help
Full code is there, or just run
Open in new window
Reagrds