locked
get-windowscapability access denied from elevated prompt RRS feed

  • Question

  • Hi All,

    I have Windows 10 1809 and the RSAT tools are now feature on demand. No problem.

    Except I run an elevated PS prompt and I get access denied when I try to run get-windowscapability or add-windowscapability

    PS C:\> Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online
    Get-WindowsCapability : Access is denied.
    At line:1 char:1
    + Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –On ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-WindowsCapability], COMException
        + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsCapabilityCommand
     
    PS C:\>

    I tried all the suggestions here:

    http://woshub.com/install-rsat-feature-windows-10-powershell/

    But there is nothing coming up about access denied. Other commandlets work OK and I have local admin rights on my machine.

    Anyone have any light to shed on this please?

    Thanks Tom.

    Tuesday, January 22, 2019 3:53 PM

Answers

  • Thanks to everyone who answered, the resolution was to use PSexec to start a powershell session as system and then run the command.

    psexec -i -s powershell.exe

    Looks like there is some additional local admin lockdown in this environment.

    Cheers Tom.


    Friday, January 25, 2019 2:06 PM

All replies

  • This is from the DISM log:

    2019-01-22 15:47:31, Error                 DISM   DismHostLib: Failed to create DismHostManager remote object. Checking for dismhost.exe exit code.
    2019-01-22 15:47:31, Info                  DISM   DismHostLib: dismhost.exe is still running. Returning previous error.
    2019-01-22 15:47:31, Error                 DISM   DISM Manager: PID=6408 TID=11652 Failed to create Dism Image Session in host. - CDISMManager::LoadRemoteImageSession(hr:0x80070005)
    2019-01-22 15:47:31, Warning               DISM   DISM Manager: PID=6408 TID=11652 A problem ocurred loading the image session. Retrying...  - CDISMManager::CreateImageSession(hr:0x80070005)
    2019-01-22 15:47:31, Info                  DISM   DISM Manager: PID=6408 TID=11652 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation
    2019-01-22 15:47:32, Error                 DISM   DismHostLib: Failed to create DismHostManager remote object. Checking for dismhost.exe exit code.
    2019-01-22 15:47:32, Info                  DISM   DismHostLib: dismhost.exe is still running. Returning previous error.
    2019-01-22 15:47:32, Error                 DISM   DISM Manager: PID=6408 TID=11652 Failed to create Dism Image Session in host. - CDISMManager::LoadRemoteImageSession(hr:0x80070005)
    2019-01-22 15:47:32, Error                 DISM   DISM Manager: PID=6408 TID=11652 Failed to load the image session from the temporary location: C:\Users\ttaylor9\AppData\Local\Temp\F34AE4A6-3089-4539-B85D-3503C8D75C8C - CDISMManager::CreateImageSession(hr:0x80070005)
    2019-01-22 15:47:32, Error                 DISM   API: PID=6408 TID=11652 m_pDismManager->CreateImageSession failed - CDismCore::CacheImageSession(hr:0x80070005)
    2019-01-22 15:47:32, Error                 DISM   API: PID=6408 TID=11652 InternalExecute failed - CBaseCommandObject::Execute(hr:0x80070005)
    2019-01-22 15:47:32, Error                 DISM   API: PID=6408 TID=8780 CAttachPathCommandObject failed - DismOpenSessionInternal(hr:0x80070005)

    Tuesday, January 22, 2019 4:11 PM
  • Works fine on all W10 for me.


    \_(ツ)_/

    Tuesday, January 22, 2019 4:23 PM
  • Hi,

    Thanks for your question.

    Please try the solutions below to fix it.

    1. The cause of Windows access rights are not configured correctly

    allow user full control.

    Go to C:\Users\USERNAME\AppData file path, Right-click on the Local folder, click properties>>security>>edit>>add>>"everyone full control" 

    Then restart your computer.

    2. Firing up gpedit and editing "Computer Configuration\Policies\Administrative Templates\System\Specify settings for optional component installation" lets you install. Just tick the box that says "Contact Windows Update directly to download repair content instead of WSUS" and apply.

    https://neosmart.net/wiki/0x80070005/

    https://www.reddit.com/r/sysadmin/comments/9l2sa5/rsat_on_windows_10_1809/

    Best Regards,

    Lee


    Just do it.

    Wednesday, January 23, 2019 7:24 AM

  • Lee.please read the question carefully.

    The RSAT tools are part of Windows 10 and do not need to be downloaded from anywhere. 

    Access denied means the user account does not have access to the folder. 

    Try it yourself.  Disconnect W10 from thenetworkand run the command. "-online" means to get the package from the online system meaning the currently running system.

    Your instructions are a bad way to fix Windows Update.  WU has nothing to do with the question asked.


    \_(ツ)_/


    • Edited by jrv Wednesday, January 23, 2019 7:58 AM
    Wednesday, January 23, 2019 7:57 AM
  • Thanks to everyone who answered, the resolution was to use PSexec to start a powershell session as system and then run the command.

    psexec -i -s powershell.exe

    Looks like there is some additional local admin lockdown in this environment.

    Cheers Tom.


    Friday, January 25, 2019 2:06 PM
  • Hi,

    I am glad to hear that your issue was successfully resolved. Please mark your answer as it would be helpful to anyone who encounters similar issues.

    Best Regards,
    Lee

    Just do it.

    Monday, January 28, 2019 9:59 AM

  • Lee.please read the question carefully.

    The RSAT tools are part of Windows 10 and do not need to be downloaded from anywhere. 

    Access denied means the user account does not have access to the folder. 

    Try it yourself.  Disconnect W10 from thenetworkand run the command. "-online" means to get the package from the online system meaning the currently running system.

    Your instructions are a bad way to fix Windows Update.  WU has nothing to do with the question asked.


    \_(ツ)_/


    You are incorrect. RSAT tools are NOT part of Windows 10 at all. They are added as a Windows Capability and are downloaded from the Microsoft servers. It has to be done via Powershell. In environments that use WSUS for updates there has to be a registry change to point the client at update location at Microsoft servers before running the command. It helps if you did a bit of research and understand how this works before jumping in. The -online switch means apply the updates to the online running operating system.

    • Proposed as answer by purepcs Friday, February 21, 2020 7:49 AM
    Wednesday, January 29, 2020 9:55 AM

  • You are incorrect. RSAT tools are NOT part of Windows 10 at all. They are added as a Windows Capability and are downloaded from the Microsoft servers. It has to be done via Powershell. In environments that use WSUS for updates there has to be a registry change to point the client at update location at Microsoft servers before running the command. It helps if you did a bit of research and understand how this works before jumping in. The -online switch means apply the updates to the online running operating system.

    They are on all of my Win10 systems.  Perhaps you don't know how to find them.  The OP was able to find them and marked the post as an answer.


    \_(ツ)_/


    • Edited by jrv Wednesday, January 29, 2020 10:26 AM
    Wednesday, January 29, 2020 10:25 AM
  • RSAT in Windows 10 1903 and above requires installation as either a capability or aa an FoD, the components are downloaded from Windows update directly therefore any WSUS settings on the system need to be overwritten.  Gary Culpan was correct, it's impossible to find a component thats not yet been installed on the system!
    Friday, February 21, 2020 7:49 AM