How is it possible to execute start-service and stop-service through a Web-interface?

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Alexander » Tue, 06 Nov 2007 01:57:53


Hi!

I want to cause PowerShell through ASP.Net app. Such commands as get-service
is caused without problems.
But start-service and stop-service is not executed. I think, it is related
to the privileges.

How is it possible to execute start-service and stop-service through a
Web-interface?
--
http://www.yqcomputer.com/ - Audio tools for C# and VB.Net developers
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Marco Shaw » Tue, 06 Nov 2007 11:16:01


Something to try if you're not concerned about security:
http://www.yqcomputer.com/

Marco

--
Microsoft MVP - Windows PowerShell
http://www.yqcomputer.com/

PowerGadgets MVP
http://www.yqcomputer.com/

Blog:
http://www.yqcomputer.com/

 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Alexander » Tue, 06 Nov 2007 18:40:07

Hi Marco!

I can execute get-process, but can't execute start-service and stop-service
etc.

--
http://www.yqcomputer.com/ - Audio tools for C# and VB.Net developers


"Marco Shaw [MVP]" < XXXX@XXXXX.COM > ???????/???????? ?
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Brandon Sh » Tue, 06 Nov 2007 22:32:00

What service are you wanting the service to stop? A Service on a client or a
service on the web server? Actually, it wouldn't matter. They both would be
problematic.
1) for the client you cant use stop/start-service because the powershell
instance is running on the web server and you have no way to control they
client machine. Start/Stop are local calls not remote
2) for the server, normally you run as a low level user. If that is the case
the user will not be able to stop/start a service.
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Alexander » Wed, 07 Nov 2007 05:40:06

Dear Brandon!

Asp.net app hosted on the server. PowerShell hosted in asp.net app on the
this server.
I want start/stop service on the server from client machine.

You can help me?

--
http://www.yqcomputer.com/ - Audio tools for C# and VB.Net developers


"Brandon Shell [MVP]" < XXXX@XXXXX.COM > ???????/???????? ? ????????
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Brandon Sh » Wed, 07 Nov 2007 05:43:05

I would assume you are correct to think its privileges.

Make sure the user the ASP.NET app is running as is in the security ACL of
the service you want to stop/start.

Brandon Shell
---------------
Blog: http://www.yqcomputer.com/
PSH Scripts Project: www.codeplex.com/psobject

AV> Dear Brandon!
AV>
AV> Asp.net app hosted on the server. PowerShell hosted in asp.net app
AV> on the
AV> this server.
AV> I want start/stop service on the server from client machine.
AV> You can help me?
AV>
AV> "Brandon Shell [MVP]" < XXXX@XXXXX.COM > ???????/???????? ?
AV> ???????? ?????????:

AV>
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Alexander » Sat, 17 Nov 2007 10:32:12

Yes, ASP.Net and service users is different. Can me help Impersonation?

http://www.yqcomputer.com/ - Audio tools for C# and VB.Net developers


"Brandon Shell [MVP]" < XXXX@XXXXX.COM > ???????/???????? ?
 
 
 

How is it possible to execute start-service and stop-service through a Web-interface?

Post by Brandon Sh » Sat, 17 Nov 2007 11:29:09

I didnt mean the account the service runs as, I mean the ACL of the service
it self.