Resolve "Run as Different User Access Denied" in Windows 11 Easily

Resolve "Run as Different User Access Denied" in Windows 11 Easily

If you encounter an "Access Denied" error when trying to use the "runas" command, the "Run as Administrator" option, or the "Run as a different user" option in Windows, follow these solutions to resolve the issue.

How to Fix "Access Denied" When Using the "Runas" Command, Run as Administrator, or Run as a Different User on Windows?​

1. Use PowerShell​

  1. Open the command line.
  2. Use the following command, but be sure to replace [user] and [command] with the appropriate user and command:
    powershell.exe -ExecutionPolicy Bypass -command "& {Start-Process powershell.exe -Credential '[user]' -ArgumentList 'Start-Process ""[command]"" -Verb runAs'}"
    powershell run as command

2. Use Group Policy​

  • Open Group Policy Management Console:
    • Press Windows + R to open the Run dialog.
    • Type gpmc.msc and press Enter.
  • Create a New Group Policy Object (GPO):
    • Right-click on the domain or organizational unit (OU) where you want to apply the policy.
    • Select Create a GPO in this domain, and Link it here....
    • Name the GPO and click OK.
  • Edit the GPO:
    • Right-click on the newly created GPO and select Edit.
  • Navigate to the Secondary Logon Service Settings:
    • Go to Computer Configuration > Policies > Windows Settings > Security Settings > System Services.
    • Find and double-click Secondary Logon.
  • Define the Policy Setting:
    • Check the Define this policy setting box.
    • Select Enabled.
    • Set the service startup mode to Manual.
  • Set Security Permissions:
    • Expand the Security node.
    • Ensure the following properties and objects are set to Allow:
      • Authenticated Users: Query Template, Query Status, Enumerate Dependents, Start, Pause, and continue, Interrogate, Read Permissions, User-Defined Control.
      • Builtin\Administrators: Full Control.
      • Interactive: Query Template, Query Status, Enumerate Dependents, Start, Pause, and continue, Interrogate, Read Permissions, User-Defined Control.
      • Service: Query Template, Query Status, Enumerate Dependents, Pause, and continue, Interrogate, User-Defined Control.
      • System: Query Template, Query Status, Enumerate Dependents, Start, Pause, and continue, Interrogate, Stop.
  • Apply the Changes:
    • Click OK to apply the security changes.
    • Click OK again to save the Group Policy changes.
  • Update Group Policy:
    • Wait for Group Policy to update automatically or force an update by running gpupdate /force in Command Prompt.
  • Test the Runas Command:
    • Try using the "runas" command, the "Run as Administrator" option, or the "Run as a different user" option to ensure the issue is resolved.

3. Check the services​

  1. Press Windows key + R and enter services.msc.
    services.msc run window windows 11
  2. Locate the Secondary Logon service and double-click it.
    secondary logon in services window
  3. Set the Startup Type to Automatic and click Start to start the service.
    secondary logon startup type
  4. Save changes and try to run the service again.

4. Check task settings​

  1. Press the Windows key + S and type scheduler. Open Task Scheduler.
    open task scheduler search results

  2. Now locate the task that tries to run the application as a different user and double-click it.
  3. In the Security options, check Run with the highest privileges and save changes.
    run with highest privileges task settings

5. Check and Modify File/Folder Permissions​

  • Take Ownership of the Folder:
    • Right-click on the folder causing the issue.
    • Select Properties.
    • Go to the Security tab.
    • Click on Advanced.
    • Next to the owner's name, click Change.
    • Type your username and click Check Names.
    • Click OK.
    • Check Replace owner on subcontainers and objects and click Apply.
  • Grant Full Control Permissions:
    • Go back to the Security tab in the folder's properties.
    • Click Edit.
    • Select your user account from the list.
    • Check the Full Control box.
    • Click Apply and then OK.
  • Apply Permissions to All Files and Subfolders:
    • Go back to the Security tab and click Advanced.
    • Check Replace all child object permission entries with inheritable permission entries from this object.
    • Click Apply and then OK.
Applying these changes ensures that you have the necessary permissions to access and modify the files and folders.

By following these solutions, you can effectively resolve the "Access Denied" error when using the "runas" command, Run as Administrator, or Run as a different user option in Windows.
Author
Windows Daily
First release
Last update

More resources from Windows Daily

Top