WSUS Support Forums: How to detect if a reboot is needed before installing a patch - WSUS Support Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to detect if a reboot is needed before installing a patch How to detect if a reboot is needed before installing a patch

#1 User is offline   KalyanPolasi 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 13-Apr-10

Posted 18 May 2010, 23:44

Hi,

I have written a script which will install the patches using WUA API.

While trying to list out all the missing patches from any desktop/server, I m getting RebootRequired property as FALSE for all the patches, though the patch requires Reboot .

If I install the same patches and if I check for the over all RebootRequired status, it is returning TRUE , in fact it is correct.

Below is the sample script I tried to get the RebootRequired Status before installing the patches:

Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
WScript.Echo "Searching.."
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
For i = 0 To searchResult.Updates.Count-1
Set update =searchResult.Updates.Item(i)
Wscript.Echo "Title: " & update.Title & " Reboot Required: " & update.RebootRequired
Next
This returns FALSE for all the patches

After installation, if I try to check the overall status of the RebootRequired flag, it is showing TRUE.
Here is the script:
Set install = updateSession.CreateUpdateInstaller()
install.Updates = updateToInstall
Set installed = install.Install()
installed.RebootRequired is returning TRUE . this is the overall status of the patch installation.

Please suggest.

Thank you,
Kalyan Polasi
0

#2 User is offline   asember 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 27-May-10

Posted 27 May 2010, 06:39

I am a noobie and this may not be what you are looking for... However, if you read the executive summaries for each patch month, for example http://www.microsoft...n/ms10-may.mspx
you will see a Restart Requirement column. This will tell you if the patches you are applying need a restart.




0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users