WSUS List Computers that Need to Reboot

This script shows a list of computers that need to be rebooted to finish installing updates. The output shows a computer followed by titles of updates that need rebooting on that

4.8 Star
Add to favorites
Windows Update
E-mail Twitter Digg Facebook
  • Output file
    1 Posts | Last post February 20, 2018
    • There is a way to list the result / outpout in a txt or csv file?
  • I got it working
    2 Posts | Last post February 20, 2018
    • Had to run directly on the WSUS server (2016 server) but it worked, and when I checked the clients it was reporting, they really did need reboots. So for those that could not get it working, that could be part of it.
      I RDP'd to the wsus server, ran the powershell ise as admin (always do out of habit not sure it was necessary) pasted the script into the script pane, ran, got results, checked those, and they needed reboot. Now I will likely modify it to output to a file or to html and make it a scheduled task at some point but great start.
    • There is a way to list the result / outpout in a txt or csv file?
  • How to pipe to file
    1 Posts | Last post February 13, 2015
    • Hi, 
       Well the script is working for me thanks! However when I try to pipe to a file using he output command or the new-item command it creates the file but no data.
      [reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | out-null
      if (!$wsus) {
              $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();}
      $computerScope = new-object Microsoft.UpdateServices.Administration.ComputerTargetScope;
      $computerScope.IncludedInstallationStates = [Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;
      $updateScope = new-object Microsoft.UpdateServices.Administration.UpdateScope;
      $updateScope.IncludedInstallationStates = [Microsoft.UpdateServices.Administration.UpdateInstallationStates]::InstalledPendingReboot;
      $computers = $wsus.GetComputerTargets();
      $computers | foreach-object {
                      $_.FullDomainName | write-host;
      new-item -itemtype file -path "c:\temp\wsus-need.txt"
  • Script Debugging
    4 Posts | Last post September 12, 2013
    • when running thru debug I'm getting 
         + FullyQualifiedErrorId : DotNetMethodException
      You cannot call a method on a null-valued expression.
      At C:\Powershell_Scripts\WSUS_Reboots.ps1:13 char:38
      + $computers = $wsus.GetComputerTargets <<<< ($computerScope); 
          + CategoryInfo          : InvalidOperation: (GetComputerTargets:String) [], RuntimeException
          + FullyQualifiedErrorId : InvokeMethodOnNull
      I made no changes to the script outside of removing the portion to list individual updates.  New to powershell so not really sure what needs to be changed, any help is appreciated.  
    • I realized that you have to run this on the wsus server unless you have powershell remote up and running.  Time to figure out how to email the output :)  
    • i am new to scripting. could someone help me to execute this script on windows 2008. when i run i got error saying that " line 1, char 1, error expected statement, code : 800A0400, Source: Microsoft VBScript compilation error". 
      Thanks in advance.
    • Try to run as an administrator, I solve the problem and the script run!
  • Errors executing the script
    2 Posts | Last post September 08, 2009
    • Hi All,
      I tried several times with different ways to execute this script in vain. Error messages for invalid characters on each line like '|', identifier expected, end of statement expected. I ran the file with extension .vbs. Is it a matter of file extension or preliminar installed soft or SDK?
      NB: I ran the script from whithin my machine XP to contact the remote WSUS server.
    • Hi,
      I finally installed Windows PowerShell. I set the policy authentication level to remote signed. I ran the script but it failed to connect.
      Is there any thing else to do before trying to connect?
      Thank you
  • List of Computers that need a reboot
    2 Posts | Last post August 24, 2009
    • We recently started using WSUS 3.0 and we now have a need to know what servers need a reboot.  I found this script for PShell not for function.  I havent used pshell for too long what am i Doing wrong?... I just need a list of the servers that need a reboot.
      I keep getting this error no matter what restriction cmd's i run.
      PS C:\Scripts> serversneedreboot.ps1
      The term 'serversneedreboot.ps1' is not recognized as a cmdlet, function, operable program, or script file. Verify the
      term and try again.
      At line:1 char:21
      + serversneedreboot.ps1 <<<<
    • Okay so i got the script to run... but i have a few questions.. I need to target a list.txt for the computers I beleive need a reboot.  I ran this on our WSUS server as is so i'm also wondering where it gets the list of users from?