Remove-WindowsFeature error "Required privilege not held"

3

Okay team, I'm trying to remove the Powershell 2.0 Core engine from my server using the command below:

Remove-WindowsFeature PowerShell-v2

The error we get is:

A required privilege is not held by the client. Error: 0x80070522 DeviceError: (@(Vhd=; Credent...Name=localhost};PSObject) FullyQualifiedErrorID: Error_Populating_Parents_For_CBS_Update,Microsot.Windows.ServerManager.Commands

And it returns the error "Required privilege not held by the client." Even when I try to list stuff with dism, it gives me the error code 1314. I also tried removing it through the "Remove Roles and Features Wizard" in Server Manager. A couple of things I have searched around for and tried:

  1. Disable Admin Approval Mode
  2. Turn UAC to the lowest possible setting
  3. Made sure powershell was running with admin privileges
  4. Explicitly adding Administrators group to "Manage auditing and security log" User Rights assignment
  5. Under "Computers/Policies/Windows Settings/Local Policy/Security Options," I toggled the setting "-Audit: Force audit policy subcategory settings (Vista or later) to override audit policy category settings" between "enabled" and "disabled"
  6. Checking the Windows Update service. I saw one link where the OP found that the service type was "Share process" or "Own Process" something like that. He changed it to the other and it started working. I have also tried toggling this.
  7. Checked file permissions on the C drive, C:\windows directory, C:\windows\WinSxS directory, and the C:\Windows\System32 directory. All of which look identical to other servers that are working.
  8. Also have all my McAfee AV/HIPS/et al. disabled.
  9. Tried removing through SCCM task sequence. Gave error that restart was needed. Restarted, tried again and no luck.

This, of course, looks like some sort of generic error that is not specific to removing/uninstalling a Windows feature with the Powershell. After all those different steps, I still receive the same error.

windows-server-2012-r2
windows-server-2012
windows-update
asked on Server Fault Oct 24, 2018 by Joseph • edited Nov 1, 2018 by Joseph

1 Answer

0

Have you tried running the same commands using a different administrator account? Maybe local administrator if you're using a domain account or vice versa.

Also, have you tried using cmd dism.exe for the same task?

Dism.exe /online /Disable-Feature /FeatureName:MicrosoftWindowsPowerShellV2 if it gives you the same error I suggest you to try using dism.exe to repair the system image.

Dism /Online /Cleanup-Image /ScanHealth
Dism /Online /Cleanup-Image /CheckHealth

Then if it detects any errors try repairing it with

Dism /Online /Cleanup-Image /RestoreHealth
answered on Server Fault Nov 1, 2018 by Awkwardy • edited Nov 1, 2018 by Awkwardy

User contributions licensed under CC BY-SA 3.0