Test Your Command-Line Before Pushing a Package!


SCCM installs software using the local system account. This sometimes presents issues when testing before packaging in SCCM, as there is no straight-forward way to run things as this account. Packaging the software, testing by deploying to a test machine, and waiting for the results can be time-consuming, so here’s an alternative method for testing your command-line as the local system account:

1. You should have PsExec on the test machine (for example, my test machine has it located in C:\Program Files (x86)\PsExec.exe). Open an admin command prompt and navigate to the location of your PsExec.

2. Enter psexec -si cmd.exe to open a command prompt as the local system account. To confirm that you’re running this command prompt as the system, you can use the command whoami. It should return nt authority\system.

3. You can now use your command line installation to run under the same conditions as SCCM!

For even more betterness, you can create a desktop shortcut with the following target (be sure to sub in a valid admin username):

C:\Windows\System32\runas.exe /user:[domain]\[admin account] “c:\program files (x86)\psexec -si cmd.exe”

This will prompt for the admin account’s password, and then launch the system command prompt.

-Derived from Richard Balsley’s post, found here

1 Response to "Test Your Command-Line Before Pushing a Package!"

Leave a Comment

Please do some math to prove you\'re a human: * Time limit is exhausted. Please reload the CAPTCHA.