title: Trying to run Get-WindowsUpdate on a remote computer but get: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
body: <p>I've got a powershell script to remote into other computers to get and install windows updates.</p>
  <p>I'm logged into the admin account on my local machine. The script starts a powershell remote session into another computer which works fine.</p>
  <p>Then once in the remote session the script should run:</p>
  <p><code>Get-WindowsUpdate -AcceptAll -Install -AutoReboot</code></p>
  <p>but i get this error:</p>
  <pre><code>Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
      + CategoryInfo          : NotSpecified: (:) [Get-WindowsUpdate], UnauthorizedAccessException
      + FullyQualifiedErrorId : System.UnauthorizedAccessException,PSWindowsUpdate.GetWindowsUpdate
  </code></pre>
  <p>I tried suggested solutions of changing the WMI permissions and I allowed this in the firewall settings but it still did not work.</p>