Saturday, December 12, 2009

PsExec.exe Access Denied

I thought PsExec.exe would never fail to start a process on remote. I got my first failure last week when I was working on a project to do a similar remote execution call as I did before for a Windows XP Prof box. I had not problem running PsExec.exe to zip a file on Windows XP box before. However, this time for that Windows XP box, I got a failure: Access denied.

I did notice a different file sharing property window when I tried to share a a folder. I thought that there must be some Windows settings difference between this one and the one I worked before. Here is the file sharing property:



I googled "PsExec Access Denied" and found some resolutions. Basically, PsExec.EXE uses SCM API (OpenSCManager, CreateService, StartService), where SCM is Service Control Manager. It is similar as Process class in .Net, or the core might be the same. Those APIs are very much based on Window security settings. Anything is not correct, then PsExec.exe may fail.

The box I run PsExec.exe successfully has the following folder sharing property:



Simple File Sharing

This difference confirms that the box I got failure has some setting issues, as indicated in this discussion in Sysinternals Forums. The first setting is easy to change. From File Explorer's menu Tools|Folder Options..., in the View Tab, clear the setting for "Use simple file sharing":



Turn off "network users identify as guests"

The second change is a security setting. From Control Panel, find the Administrative Tools snap-in, open Local Security Settings. Then find Local Policies->Security Options. Look for the line "Network Access:Sharing and security model for local accounts". The value for this "key" was the default value of "Guest only - local users authenticate as Guest". Change it back to "Classic - local users authenticate as themselves".



After all those changes. I did not reboot the box. Just waited for a while. Then I got my PsExec.exe working, remotely zip files on the remote by using 7-zip tool!

6 comments:

Anonymous said...

I have the same problem and i did your steps recomended but my problem continues

Anonymous said...

Indeed I followed the steps and I still continue to get the error. Every machine has the same image, but only some machines get this error

Anonymous said...

I too have the same problem, tried these steps, didnt help.

Anonymous said...

thnx ur post helped me solve my problem.....
For others ....

These two are the links u need to follow to get it to work including above post.


http://forum.sysinternals.com/topic15919.html


http://serverfault.com/questions/8805/psexec-access-is-denied

kunal said...

http://kunaludapi.blogspot.in/2015/08/multiple-ways-to-install-software_23.html

kunal said...

http://kunaludapi.blogspot.in/2015/08/multiple-ways-to-install-software_23.html