0

I'm trying to write a web service on my server windows server2008 to invoke some applications on my server. I user system.diagnostics.process class to invoke exe files. It works fine on server itself, but when i use the webservice over a different pc, I got error message which is specified file not found. But when I just launch cmd.exe it works fine too. As far as i understand I have access to server which i can run at least cmd.exe on. But when it comes to invoke different exe's it just doesn't work. I have another clue too, when I run the cmd.exe remotely it runs, and I try to kill it remotely then it gives me the error "Access denied".

I'm not familiar with this kind of server access,permission jobs. Hence I need some help. Any help would be appreciated :)

Tolga Evcimen
  • 7,112
  • 11
  • 58
  • 91

1 Answers1

0

You need to make sure that the Application Pool in IIS in running as a user that has permission to execute the executables on that server.

Just a word of warning (as you may know): this is a huge security risk if you expose these services out to anywhere. Opening up a service to run an application can be risky so I would make sure that there's no other way to do what you're trying to accomplish.

Garrett Vlieger
  • 9,354
  • 4
  • 32
  • 44
  • So you are saying that I should open up a service to run applications as I was doing before but assigning that applications to a user who has the necessary permissions but while giving those permissions I should be extra careful. Did I get it right? if so what is the way of doing this? could you please at least give me some clue to start researching about it:)) – Tolga Evcimen Jul 06 '12 at 22:25
  • Correct. If this web service is hosted in IIS, take a look at the App Pool configuration that the application is using. In there you can specify the user that the process will run under, and this should be a user with necessary permissions on the server. Look here for more info: http://technet.microsoft.com/en-us/library/cc771170(v=ws.10).aspx. – Garrett Vlieger Jul 06 '12 at 22:28
  • I've looked into those pages. I understand what it is that I'm dealing with. I created a new application pool put my web assigned my webservice to it and assigned the administrator to it as a Identity. Before this I wasn't able to start some applications but now they all start. But unfortunately they are still without any user interface :/ i've looked for it and people suggests enabling "Allow service to interact with desktop" checkbox in administrative tools->services. But I didnt seem to find my own web service or IIS admin. any idea? – Tolga Evcimen Jul 09 '12 at 11:47