How to run PowerShell as administrator in Server Core
You must run PowerShell as the user "Administrator", to administrative privileges in Windows Server Operating System. All the administrative level commands in PowerShell need administrative privileges to run in Windows Server Operating System. If you are not logged-in as an administrator in a Server Core installation, use "runas" command to open a PowerShell window with administrative privileges.
In a Windows Server 2025 Server Core installation, use "runas" command from Command Prompt "cmd.exe" or PowerShell, to run PowerShell as administrator. Enter the password of administrator, when prompted. Below format of runas command can be used to run PowerShell as administrator.
C:\Users\jajish>runas /user:OMNISECU-SERV-06\administrator powershell
Please note that in this case, OMNISECU-SERV-06 is the name of the Windows Server computer. "OMNISECU-SERV-06\administrator" user name format is also called as Down-Level Logon Name. The first part of the Down-Level Logon Name can be a Domain name also, instead of computer name. Please refer following link for more information about different User Name Formats in Windows Server.
Following lines show the "runas" command output. A new PowerShell Windows is opened after the "runas" command execution in Windows Server 2025 Server Core installation.
C:\Users\jajish>runas /user:OMNISECU-SERV-06\administrator powershell Enter the password for OMNISECU-SERV-06\administrator: Attempting to start powershell as user "OMNISECU-SERV-06\administrator" ... C:\Users\jajish>
Please refer the following image to see the above mentioned "runas" command executed in a Windows Server 2025 Server Core installation.
A new PowerShell terminal window will be opened with administrative privileges, as shown in below screenshot.
Written by Jajish Thomas.
Last updated on 3rd June, 2024.