Windows Update PowerShell Module

This function is a piece of PSWindowsUpdate module to manage Windows Update on a computer system running Windows. Whole module contain set of functions to check, download and install updates from PowerShell.

 
 
 
 
 
(204)
180,768 times
Add to favorites
Windows Update
12/18/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • how to update windows 10 from PowerShell?
    1 Posts | Last post August 04, 2015
    • Thanks. This is because windows 10 setting wont work.
      
      Thanks
      
      Jose
  • Zip file is null bytes
    1 Posts | Last post July 31, 2015
    • Hi, 
      i got the same Problem, the Zip File Attachment is only 0 Bytes. Could you please check it and maybe upload ist again ?
      
      Best regards
  • Zero bytes zip file
    1 Posts | Last post July 30, 2015
    • Hello,
      
      Since this afternoon I'm unable to download the zip file, its size is null. Tryed with multiple computers, same problem everywhere.
      
      In fact I'm using a Chocolatey package which come download the zip file from here, I've got about twenty computers waiting this mod to install. :) The problem also occurs directly within any browser.
      
      Any clue, guys?
      Help appreciated, thank you in advance.
      
      Regards,
      Chris.
  • Always showing the current downloading KB is 3MB.
    2 Posts | Last post July 17, 2015
    • Dear Michal,
      When using get-wuinstall at step 3, all downloading KB size is showing as 3 MB. Is it correct ?
    • P.S. I don't know where the value "3 MB" came from. It might not different.
      
      Another question is , on step 3, sometimes the downloading just looks like paused, it might stay at one downloading for over 10 minutes, seems no background process is running. the next log on WindowsupdateClient was 10 minutes later. Like below:, any idea that I where I can check what was going on while the gap ?
      
      Information,7/17/2015 2:15:16 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 2:14:52 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 2:14:52 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 2:04:28 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 2:04:16 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      ...
      Information,7/17/2015 2:00:47 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 2:00:43 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 1:43:58 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
      Information,7/17/2015 1:43:53 AM,Microsoft-Windows-WindowsUpdateClient,41,Windows Update Agent,An update was downloaded.
  • Download non-express cab files?
    1 Posts | Last post July 14, 2015
    • I'm wanting to use this script for the purpose of using the downloaded cab's with DISM to service a wim for deployment. 
      
      It appears if I use Get-WUInstall with the -downloadonly switch the majority of updates downloaded are the express version which DISM doesn't like.
      
      Is there any easy way to force it to download the "full" version?
  • Exception calling CreateUpdateDownloader Access is denied
    1 Posts | Last post July 14, 2015
    • I am trying to run this on a remote server using Invoke-Command with credentials for a system administrator.  The module is installed on the remote computer, and I can run Get-WUList fine etc.  However when I run 
      
      Get-WUInstall –Category "Security Updates" -AcceptAll -DownloadOnly -AutoReboot 
      
      It gives me the error:
      
      Exception calling "CreateUpdateDownloader" with "0" argument(s): "Access is denied
      
      Any suggestions would be gratefully received.
  • COM Exception when using get-wulist to query a remote machine
    10 Posts | Last post July 07, 2015
    • This module is superb and works well locally. But I get this COM Exception when I try to use get-wulist to query a system remotely. I tested this against a few machines and they all throw the same exception. Could this be due to a permission on the COM object?
      
      Exception calling "CreateInstance" with "1" argument(s): "Retrieving the COM class factory for remote component with CLSID {4CB43D7F-7EEE-4906-8698-60DA1C38F2FE} from machine 
      xxxxxxx failed due to the following error: 800706ba xxxxxxx."
      At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\PSWindowsUpdate\Get-WUList.ps1:254 char:6
      +                     $objSession =  [activator]::CreateInstance([type]::GetTypeFromProgID("Micro ...
      +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : COMException
    • Hi,
      Check firewall settings.
    • Thank you! Yes, it was a rule on the Windows Firewall. This module is awesome!
    • What did you change on the Firewall, please?
    • Ran into this also ... googling and wiresharking leads me to the conclusion that initial contact with the remote client happens on TCP 135, but then redirects to a High-Rang port that is dynamically selected. As of Win 2008, this is 49152 - 65535.
      
      So it seems we have to either open up that range, or just disable firewall on the client.(?)
    • In windows 2012 R2, there are two firewall rules that should already exist, that should be enabled - under Inbound rules, Select Com+ Network Access (DCOM-In) and COM+ Remote Administration (DCOM-In), and enable these rules. 
      
    • Dear Michal,
      thank you for publishing this module!
      
      Dear SunnySNair,
      it is great that you found out "... Yes, it was a rule on the Windows Firewall"
      But which one?
      I'm encountering the same Problem and it would make sense, if I don't have to Experiment, if you already have the answer!
      
      Dear Chadwick Cooper,
      it was not (enough) to enable the two inbound rules!
      But: Thanks a lot!
      
      best regards,
      Klaus
      
      
      
      
    • As stated by Chadwick Cooper, I enabled these two inbound rules:
      
      Com+ Network Access (DCOM-In)
      COM+ Remote Administration (DCOM-In)
      
      This alone did not solve my problem. Opening up the port range provided by Martin Bird for TCP *did* solve the problem:
      
      49152-65535
      
      So for me, it took enabling those two rules *and* opening the port range for TCP for things to work. Martin said that's the range, but how exactly could that have been determined. And I can't find through Google a definitive answer, so going with this solution for now.
      
    • I did further research, and found this reference to the required ports for the .net objects used in the modules. 
      https://msdn.microsoft.com/en-us/library/windows/desktop/aa387288(v=vs.85).aspx
      
      Exerpt:
      
      The following ports and exceptions must be added to the Windows firewall settings for Windows Vista and Windows Server 2008 for the WUA API to be called remotely.
      Exception 1
      Local port: 135
      Remote port: ALL
      Protocol number: 6
      Executable: %windir%\system32\svchost.exe
      Service: rpcss
      Remote privilege: Administrator
      Exception 2
      Local port: Dynamic RPC
      Remote port: ALL
      Protocol number: 6
      Executable: %windir%\system32\dllhost.exe
      Remote privilege: Administrator
      The following list contains tools that can be used to configure Windows Firewall settings:
      Windows Firewall with Advanced Security snap-in
      Group Policy
      Netsh advfirewall command-line tool
      
      I did further testing, and found that by default, the first rule is usually enabled through the Windows Management Instrumentation (DCOM-In) inbound rule. I did have to generate a new rule for the second rule, which resolved the issue. 
       
    • Default rules did the trick for me (after being enabled that is). No need for extra ports being opened...
      
      COM+ Network Access (DCOM-In)	COM+ Network Access	All	Yes	Allow	No	%systemroot%\system32\svchost.exe	Any	Any	TCP	135	Any	Any	Any	Any	Any	Any	
      COM+ Remote Administration (DCOM-In)	COM+ Remote Administration	All	Yes	Allow	No	%systemroot%\system32\dllhost.exe	Any	Any	TCP	RPC Dynamic Ports	Any	Any	Any	Any	Any	Any	
  • Will module be ready for Windows 10?
    2 Posts | Last post July 01, 2015
    • I used this module when updating Windows 8.1 in audit mode, and it worked very well.
      
      I am testing Windows 10 now (in audit mode), and this module unfortunately does not work in this OS.
      
      Will there be a similar module for Windows 10 in the future?
    • Please disregard this question. It WORKS in Windows 10 audit mode!
      
      (I messed up with my network settings in the VM)
  • Great script
    1 Posts | Last post June 25, 2015
  • Get-WUInstall (all) error on Server 2012 R2 Core
    2 Posts | Last post June 25, 2015
    • Exception calling "CreateUpdateDownloader" with "0" argument(s): "Access is denied. (Exception from HRESULT:
      0x80070005 (E_ACCESSDENIED))"
      At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\Get-WUInstall.ps1:807 char:5
      +                 $Downloader = $objSession.CreateUpdateDownloader()
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : ComMethodTargetInvocation
      
      The property 'Updates' cannot be found on this object. Verify that the property exists and can be set.
      At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\Get-WUInstall.ps1:808 char:5
      +                 $Downloader.Updates = $objCollectionTmp
      +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : PropertyNotFound
    • Have you installed PowerShell 2.0 or higher, and running the script as admin? To check your PowerShell version, run $PSVersionTable.
11 - 20 of 174 Items