CMD as the Local System account

Recently we ran into a nightly job that wasn’t running properly.  It was scheduled to run as the local system, and it looked like the machine account had the rights necessary to move a couple files around.  Since it was failing, we needed to determine what part was failing.

Since the job had changed machines, the #1 suspect was permissions.  These looked OK, but we needed to test the job as the local system account, and wanted to do it interactively so we could diagnose any issues.

However, you can’t use runas to fire up a cmd prompt as the local system.  However, as this TechNet article points out, you can do it with PsExec.

PSEXEC -i -s -d CMD

If you want to double check, run WHOAMI /USER

Update:  You can do the same thing to open up PowerShell or the PowerShell ISE.

psexec -i -s Powershell.exe
psexec -i -s Powershell_ise.exe
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s