I’m new at this and have searched for 2 days trying to resolve…sorry if basic…
no matter how I try to get back, returns NaN or nothing…
(New-Object -com “Microsoft.Update.AutoUpdate”).Settings
trying to get the NotificationLevel setting back…
What am I missing?
FULL ORIGINAL SCRIPT BLOCK:
$res = (New-Object -com “Microsoft.Update.AutoUpdate”).Settings
$lvl = $res.notificationlevel
switch ($lvl)
{
1 {$msg=“Windows Updates set to `"Never Check`”“}
2 {$msg=“Windows Updates set to `"Check but let me choose to download/install`””}
3 {$msg=“Windows Updates set to `"Download but let me choose to install`”“}
4 {$msg=“Windows Updates Updates set to `"Auto Update`””}
default {$msg=“Windows Updates status couldnt be determined”}
}
Write-Host $msg
Write-Host “Message.WinUpdates: $msg”
Write-Host “Statistic.WinUpdates: $lvl”
appreciate any help