Avatar of total123
total123
Flag for United Kingdom of Great Britain and Northern Ireland 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"
Windows OSWindows Server 2008

Avatar of undefined
Last Comment
total123

8/22/2022 - Mon
Alex

https://gallery.technet.microsoft.com/scriptcenter/Get-WindowsUpdate-Retrieve-e53aea50


Full code is there, or just run

 get-windowsupdate | Export-csv c:\temp\WU.csv

Open in new window


Reagrds
total123

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
Alex

Is it windows server 2008 or 2008R2?

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] 
            } 
        } 
    } 

Open in new window

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
total123

ASKER
its 2008 r2
Merete

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
total123

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 ?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Merete

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
total123

ASKER
thanks for your help