[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Find all machines if Windows automatic updates is enabled or disabled

Posted on 2007-08-10
10
Medium Priority
?
236 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:bsharath
  • 5
  • 4
10 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 19675149
0
 
LVL 14

Expert Comment

by:canali
ID: 19675417
@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
 
LVL 11

Author Comment

by:bsharath
ID: 19675448
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:canali
ID: 19676086
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
 
LVL 11

Author Comment

by:bsharath
ID: 19676203
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
 
LVL 14

Expert Comment

by:canali
ID: 19676349


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
 
LVL 11

Author Comment

by:bsharath
ID: 19676380
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
 
LVL 14

Expert Comment

by:canali
ID: 19676424

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
 
LVL 11

Author Comment

by:bsharath
ID: 19676465
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
 
LVL 14

Accepted Solution

by:
canali earned 2000 total points
ID: 19676715
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you considered what group policies are backwards and forwards compatible? Windows Active Directory servers and clients use group policy templates to deploy sets of policies within your domain. But, there is a catch to deploying policies. The…
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question