Tuesday, August 05, 2014

Command prompt running as NT AUTHORITY\Network Service

Here's a convenient way to get a command prompt running as Network Service. This is useful for troubleshooting authentication issues for services running as Network Service.

Get Psexec from http://live.sysinternals.com/psexec.exe.

Run:

psexec -u "NT AUTHORITY\Network Service" -i cmd

Or, if you prefer PowerShell:

psexec -u "NT AUTHORITY\Network Service" -i powershell

Or, if you prefer PowerShell, and a bigger than standard window with some distinguishable color:

psexec -u "NT AUTHORITY\Network Service" -i powershell -noexit "cd c:\ ; mode con:cols=170 lines=60 ; (Get-Host).UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(170,3000) ; (Get-Host).UI.RawUI.BackgroundColor='DarkCyan' ; clear"



No comments:

Post a Comment