VBS Script to force a Wsus update detection on a single computer


This script forces a Windows Update Detection immediately on single computer by inputing either its name or IP.

Copy below text and save as Force a Wsus update detection on a single computer.vbs

' Force a Windows Update Detection now on single computer by inputing name or IP of computer
'Script is now ignoring errors. For those who wish to see errors just add a ' to the on error resume next below 
on error resume next
strComputer = inputbox("Enter a computer name or IP address to run a WUA detection now","Invoke detectnow")
if strComputer = "" then wscript.quit
Set autoUpdateClient = CreateObject("Microsoft.Update.AutoUpdate",strComputer)
AutoUpdateClient.detectnow()
wscript.echo "All done."

Advertisements

One Response to VBS Script to force a Wsus update detection on a single computer

  1. Sinan Bekmez says:

    I customized the script removing hostname entry section as following;

    strComputer = “localhost”
    Set autoUpdateClient = CreateObject(“Microsoft.Update.AutoUpdate”,strComputer)
    AutoUpdateClient.detectnow()
    wscript.echo “All done.”

    it can be used on a single machine as needed.
    Regards,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: