Find all machines if Windows automatic updates is enabled or disabled

Hi,

As we have our windows update server which pushes all updates to the machines the Mycomputer > Properties > Automatic updates is disabled. I need a script to query this part and tell me if it is disabled or enabled.So users enable it...

I have the machine names in the file.

In the registry what is the key that can turn this on.

Regards
Sharath
LVL 11
bsharathAsked:
Who is Participating?
 
canaliCommented:
automatic update are scheduled by the user not via gpo and automatically installs ...
http://www.microsoft.com/technet/community/columns/scripts/default.mspx
For better or worse, its possible to have the Automatic Updates service running yet still turn off Automatic Updates. Needless to say, knowing whether or not Automatic Updates is enabled is very important. Heres a script that will not only tell you whether or not Automatic Updates is enabled, but will also tell you the notification level that has been configured (that is, whether updates will be automatically downloaded and installed, whether they will automatically be downloaded but not installed, etc.).

0
 
Brian PiercePhotographerCommented:
0
 
canaliCommented:
@echo off
:: check windows autoupdate is enabled "switched on" computers found in the list c:\computers.txt
::
:: save as checkALLWUA.cmd
:: Gastone Canali
:: file needed:
:: c:\computers.txt
:: c:\checkWUA.vbs
:: c:\psexec.exe
setlocal ENABLEDELAYEDEXPANSION
for /f %%c in ('type c:\computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_checkWUA %%c
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul) ||echo %%c:  switched off
)
goto :_END
:_checkWUA
  copy /Y c:\checkWUA.vbs \\%%C\admin$\temp
  c:\psexec.exe -i -s psexec.exe \\%%c  -i -s cscript.exe //nologo  "c:\windows\temp\checkWUA.vbs"
goto :_EOF
:_END
:_EOF


'*** vbs script start here
' save as checkWUA.vbs in c:\
'Set WshNetwork = WScript.CreateObject("WScript.Network")
ComputerName = WshNetwork.ComputerName

Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
Set objSettings = objAutoUpdate.Settings

Select Case objSettings.NotificationLevel
    Case 0
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is not configured by the user " & _
            "or by a Group Policy administrator."
    Case 1
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is disabled."
    Case 2
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates prompts users to approve updates " & _
            "before downloading or installing."
    Case 3
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically downloads " & _
             "updates, but prompts users to approve them before installation."
    Case 4
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically installs " & _
            "updates per the schedule specified by the user."
    Case Else
        Wscript.Echo ComputerName & " :Notification level could not be determined."
End Select



0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bsharathAuthor Commented:
I get this...

The network path was not found.
        0 file(s) copied.

PsExec v1.63 - Execute processes remotely
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com

Couldn't access %c:
The network path was not found.

Make sure that the default admin$ share is enabled on %c.
Press any key to continue . . .
0
 
canaliCommented:
sorry, there was an error in both scripts.

@echo off
:: check windows autoupdate is enabled "switched on" computers found in the list c:\computers.txt
:: correct version
:: save as checkALLWUA.cmd
:: Gastone Canali
:: file needed:
:: c:\computers.txt
:: c:\checkWUA.vbs
:: c:\psexec.exe
setlocal ENABLEDELAYEDEXPANSION
for /f %%c in ('type c:\computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_checkWUA %%c
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul) ||echo %%c:  switched off
)
goto :_END
:_checkWUA
  copy /Y c:\checkWUA.vbs \\%1\admin$\temp
  c:\psexec.exe  \\%1  -i -s cscript.exe //nologo  "c:\windows\temp\checkWUA.vbs"
goto :_EOF
:_END
:_EOF

'*** vbs script start here
' save as checkWUA.vbs in c:\
' corrected version
Set WshNetwork = WScript.CreateObject("WScript.Network")
ComputerName = WshNetwork.ComputerName

Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
Set objSettings = objAutoUpdate.Settings

Select Case objSettings.NotificationLevel
    Case 0
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is not configured by the user " & _
            "or by a Group Policy administrator."
    Case 1
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is disabled."
    Case 2
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates prompts users to approve updates " & _
            "before downloading or installing."
    Case 3
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically downloads " & _
             "updates, but prompts users to approve them before installation."
    Case 4
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically installs " & _
            "updates per the schedule specified by the user."
    Case Else
        Wscript.Echo ComputerName & " :Notification level could not be determined."
End Select
0
 
bsharathAuthor Commented:
Which file should i run and where will the results come to..

I created 2 files and ran the cmd file but no results..
0
 
canaliCommented:


Save the 1st  cmd batch as c:\checkALLWUA.cmd
::*** batch start here checkALLWUA.cmd
@echo off
:: check windows autoupdate is enabled "switched on" computers found in the list c:\computers.txt
:: correct version
:: save as checkALLWUA.cmd
:: Gastone Canali
:: file needed:
:: c:\computers.txt
:: c:\checkWUA.vbs
:: c:\psexec.exe
setlocal ENABLEDELAYEDEXPANSION
for /f %%c in ('type c:\computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_checkWUA %%c
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul) ||echo %%c:  switched off
)
goto :_END
:_checkWUA
  copy /Y c:\checkWUA.vbs \\%1\admin$\temp
  c:\psexec.exe  \\%1  -i -s cscript.exe //nologo  "c:\windows\temp\checkWUA.vbs"
goto :_EOF
:_END
:_EOF
::*** end batch here checkALLWUA.cmd
 
------------------------------------------------------------------------------------------------
Save the 2nd file checkWUA.vbs in c:\

'*** vbs script start here checkWUA.vbs
' save as checkWUA.vbs in c:\
' corrected version
Set WshNetwork = WScript.CreateObject("WScript.Network")
ComputerName = WshNetwork.ComputerName

Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
Set objSettings = objAutoUpdate.Settings

Select Case objSettings.NotificationLevel
    Case 0
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is not configured by the user " & _
            "or by a Group Policy administrator."
    Case 1
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates is disabled."
    Case 2
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates prompts users to approve updates " & _
            "before downloading or installing."
    Case 3
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically downloads " & _
             "updates, but prompts users to approve them before installation."
    Case 4
        Wscript.Echo ComputerName & " :Notification level, Automatic Updates automatically installs " & _
            "updates per the schedule specified by the user."
    Case Else
        Wscript.Echo ComputerName & " :Notification level could not be determined."
End Select
'*** vbs script end here checkWUA.vbs

After these run the batch c:\checkALLWUA.cmd
if u want the output in a file
c:\checkALLWUA.cmd >myresult.txt
0
 
bsharathAuthor Commented:
I get this.

What does this mean.
        1 file(s) copied.
DEV-CHEN-MRD100 :Notification level, Automatic Updates automatically installs updates per the schedule specified by the user.


And what is the file that is copied.
0
 
canaliCommented:

http://support.microsoft.com/kb/306525
http://technet2.microsoft.com/windowsserver/en/library/51c8a814-6665-4d50-a0d8-2ae27e69ca7c1033.mspx?mfr=true
you can have different situationson your computer
1)
:Notification level, Automatic Updates is not configured by the user or by a Group Policy administrator.
2)  
 :Notification level, Automatic Updates is disabled.
3)
:Notification level, Automatic Updates prompts users to approve updates before downloading or installing
4)
:Notification level, Automatic Updates automatically downloads updates, but prompts users to approve them before installation."
5)
:Notification level, Automatic Updates automatically installs updates per the schedule specified by the user."
6)
  ComputerName & " :Notification level could not be determined."

0
 
bsharathAuthor Commented:
So what does this mean?

Notification level, Automatic Updates automatically installs updates per the schedule specified by the user.

What is the file that's being copied.?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.