I am looking for a way to check whether windows OS and security updates are up to date or not. If not then I would like to fetch this information. Apart from this, If there is any update available then I would like to fetch this information too.
I read several blogs and StackOverflow questions and got the following answers:
- Using
wmic qfe list
but this gives information about the already installed update without status (I need to read status such as fail, aborted or success). - Using the following Powershell script (this gives information about whether an update is available or not):
$u = New-Object -ComObject Microsoft.Update.Session
$u.ClientApplicationID = 'MSDN Sample Script'
$s = $u.CreateUpdateSearcher()
$r = $s.Search('IsInstalled=0')
$r.updates|select -ExpandProperty Title
Is there any way to check "Whether windows OS and security updates are up to date or not? If not then get status (failure, aborted etc.). If any update is available then I would like to fetch information about the available update".
How can I achieve this using Javascript or Node.js?