Solved

Using PSExec with System Account on a logged off domain machine

Posted on 2015-01-27
8
317 Views
Last Modified: 2015-02-27
Hi Experts,
I’m looking for some assistance using PSExec (or a similar method) to trigger a remote command from a domain machine whilst it is in a logged off state (I.e. at the login screen).
Essentially, I am using OS deployment software (smartdeploy) to install a Win7 image on my domain PC, the software adds the PC to the domain, and leaves it at the login prompt – which is all fine.
The software gives me the option to run a command at first boot (using only the system account), when the machine is sitting at the login prompt.
I want to be able to use PSExec to trigger my application deployment software (PDQ Deploy) – something to this effect:

PSexec.exe \\PDQSERVER –accepteula –u username –p password Pdqdeploy.exe Deploy “PackageNameWhatever” %computername%

I’ve tested this and similar commands whilst logged into a machine and it works flawlessly – the command uses the computername variable to install the package directly to the PC, however have tried different combinations, tried to specify different credentials, parameters etc whilst the machine is logged off but no luck. Understand it is likely a permissions issue but not sure how I can get around it.

Hoping someone can provide some guidance or maybe an alternative approach. The two software packages work well together for OS and application deployment, however I would like to be able to automate the whole process and have our default application package install, as soon as the OS is deployed and the machine has joined the domain, got an IP address etc.

Cheers!
0
Comment
Question by:bl460c
8 Comments
 
LVL 23

Expert Comment

by:Nagendra Pratap Singh
ID: 40572449
Do you have a local admin account?
0
 
LVL 54

Accepted Solution

by:
McKnife earned 500 total points
ID: 40572653
Hi.

I think the problem is that the system account cannot impersonate anyone. Proof: If you start
psexec -s -i cmd
a shell running as system appears. Within that shell, try to use runas.exe to impersonate youruser and start notepad:
runas /user:domain\youruser notepad
You get
"RUNAS ERROR: Unable to run - notepad
5: Access is denied."
0
 

Author Comment

by:bl460c
ID: 40583275
Nagendra Pratap Singh - yes I have a local admin account (or I could create a specific local admin account for this purpose - how are you suggesting it could be used?) cheers
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 23

Expert Comment

by:Nagendra Pratap Singh
ID: 40583316
I would use a local admin account in the meantime.

Also check if your process is not blocked by UAC etc.

http://www.brandonmartinez.com/2013/04/24/resolve-access-is-denied-using-psexec-with-a-local-admin-account/
0
 
LVL 54

Expert Comment

by:McKnife
ID: 40583356
Did you understand my comment? It's the reason for why it's not possible.
0
 
LVL 59

Expert Comment

by:LeeTutor
ID: 40634972
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 54

Expert Comment

by:McKnife
ID: 40634973
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Windows_7/Q_28604512.html#a40572653 is the solution. It is a known fact that the system account does not offer to use impersonation, that's why it won't work for the asker.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't log in to windows 7 11 60
IE11 Crashing - Appears Company Wide 7 117
Slow computer- outside access? 14 43
Windows Updates Batch Files (now with executables!) 32 40
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question