How To Open Powershell As Administrator

How To Open Powershell As Administrator

Reading time1 min
#Windows#PowerShell#Administration#PowerShellAdmin#WindowsAdmin

Mastering Elevated PowerShell: Consistent Techniques for Administrator Access Across Windows

On any Windows environment—especially when automating infrastructure or tuning system security—standard user rights in PowerShell won't cut it. Critical modules for managing local users, Windows Defender policies, or system updates require elevation. Expect error codes such as:

Access is denied.
At line:1 char:1
+ Set-ExecutionPolicy RemoteSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

Consistent elevation is a baseline skill for Windows admins, often overlooked until a script fails in CI pipelines or during endpoint provisioning.


Why Elevation Is Mandatory

  • System-level operations: Module imports (e.g., Import-Module ActiveDirectory), service management, or interacting with protected registry keys trigger UAC unless elevated.
  • Automation: Runbooks leveraging DSC, Chocolatey, or custom deployment scripts break without admin rights.

Quick test: launch PowerShell as a standard user and try New-LocalUser. Permission error is instant.


Quick Reference Table

MethodActivationSupported OSContext/Notes
Start Menu, right-clickSearch powershell, right-click, select Run as administrator7/10/11UI/label varies; works everywhere
Keyboard shortcutStart, search powershell, focus result, Ctrl+Shift+Enter7/10/11No mouse
Task Manager RunCtrl+Shift+Esc > File > Run new task, type powershell, check admin box7/10/11Survives shell crashes
Run dialog shortcutWin+R, type powershell, Ctrl+Shift+Enter7/10/11Fast; minimal UI
Start-Process self-elevationStart-Process powershell -Verb runAs from existing shellanyPops UAC, launches new window
Pinned shortcut (persistent)Shortcut > Properties > Advanced > Run as administrator7/10/11Ideal for repeated access
Windows Terminal (Admin)Terminal dropdown arrow > Windows PowerShell (Admin)10/11 + WTRequires Windows Terminal

1. Start Menu and Keyboard Triggers

The classic method—reliably available since Windows 7.

Standard steps:

  1. Press Win key, type powershell.
  2. Right-click the result. Choose Run as administrator.

Engineer’s shortcut: After typing "powershell", keep hands on the keyboard—Ctrl+Shift+Enter executes any highlighted app with elevation. This approach avoids context menu distractions and works on domain-joined endpoints with Start Menu policies.


2. Task Manager Run-as Trick

When the shell fails (broken Explorer, unresponsive Start menu), Taskmgr.exe is your fallback:

  1. Launch Task Manager: Ctrl+Shift+Esc
  2. File > Run new task
  3. Type powershell
  4. Enable Create this task with administrative privileges
  5. Confirm

Worked even in locked-down kiosk environments; one caveat—this method relies on Task Manager not being disabled by Group Policy.


3. Run Dialog with Elevation

Speed-focused admins can run:

  • Win+R
  • Type: powershell
  • Press: Ctrl+Shift+Enter

No mouse, no navigation, no bloat.


4. Persistent Elevated Shortcut

For repeat work (e.g., testing new GPO scripts or debugging installers), a desktop or taskbar shortcut saves time:

powershell.exe
  • Right-click > Properties > Shortcut > Advanced
  • Check Run as administrator
  • Pin it to taskbar, Start, or leave on Desktop

Note: Color the window title or use custom backgrounds in shortcut’s properties (powershell.exe -NoExit -Command "$host.UI.RawUI.BackgroundColor = 'DarkBlue'; Clear-Host") to reduce accidental execution in wrong session.


5. Elevate From an Existing Non-Admin Shell

If you launched an unprivileged window by mistake—avoid closing terminals and losing context:

Start-Process powershell -Verb runAs

This opens a new, elevated instance—UAC consent required as usual.

  • Use parameters: -NoExit -Command "<init script>" for chaining setups.
  • Not ideal if you need to preserve working directory—add -WorkingDirectory "$PWD".

6. Windows Terminal Scenarios (Windows 10 1903+/11)

With Windows Terminal, you can rapidly start PowerShell as admin by:

  • Clicking the dropdown arrow (top bar)
  • Selecting Windows PowerShell (Admin)

Or, for comprehensive workflows, override the profile in settings.json with "elevate": true (when support exists), or create a specialized shortcut with:

wt.exe -w 0 nt -p "Windows PowerShell" -d . --profileName "Admin"

Gotcha: Running Windows Terminal itself as admin elevates all shells inside, which may be unnecessary—and risky—for regular sessions.


Real-World Example

Automated scripts dispatched via SCCM often fail if the executing PowerShell process isn’t running with the correct token. Checking for elevation programmatically avoids silent script failures:

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host "Elevation required. Relaunching..." -ForegroundColor Red
    Start-Process powershell -Verb runAs
    exit
}

This quick check reruns the script in admin mode, preventing hours lost to access errors buried in logs.


Nuances, Edge Cases, and Non-obvious Issues

  • Credential Guard: Even with elevation, some modules (e.g., device management via CIM) require further permissions or sign-in.
  • UAC off? Disabling UAC negates most “as admin” prompts but increases risk; Group Policy still enforces token separation in many enterprise images.
  • Legacy PowerShell versions (<5.1): Some older images require different invocation syntax; on Windows Server Core, only CMD may be available by default.

Summary

Every serious Windows admin needs muscle memory for at least three elevation methods. Streamline by using keyboard shortcuts, and always test your deployment scripts in both regular and elevated contexts. Persistent shortcuts or Windows Terminal profiles minimize friction during rapid troubleshooting. Side effect: after adopting these patterns, “Access Denied” ceases to be a bottleneck for most management tasks.


References & Further Reading