Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How to stop/start a service on a local machine

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2111
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to stop/start a service on a local machine
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How to stop/start a service on a local machine - 2/18/2005 10:02:21 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Hi all,

Any idea how to stop/start a service on a local machine (from which the script is executed) when the user that runs the script doesn't have the necessary rights ?

Thanks.

_____________________________

Hope this helps.
 
 
Post #: 1
 
 Re: How to stop/start a service on a local machine - 2/18/2005 2:41:16 PM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
token I have a script that will runas you that will kill the service or start the service but what your looking for is for that user to have rights to stop and start the service. And would thing that is possible by launching gpedit.msc and giving user rights but as you well Know global overrights local, thus the only soultion would be to right a script with runas which may or may not have admin user name and password in it. There are third party softwares out there you may be able to make it harder for average use not to get this info but the above average use will. Here is one link that discusses this. I have been looking for something simalar so the will stop calling me and I run it from my desktop with runas to theres. Heres the link good luck and if you don't mind let us all know what you come up with.

http://groups-beta.google.com/group/microsoft.public.scripting.wsh/msg/95b52b798cc526e4b

(in reply to token)
 
 
Post #: 2
 
 Re: How to stop/start a service on a local machine - 2/18/2005 3:29:30 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Thanks a lot tnoonan, I'll check out the link in a bit. I thought about using runas, but can't get it to accept the password as it requires the password to be typed. I tried to pipe it and it didn't work. Did you know how to use runas in this fashion ?

Thanks

(in reply to token)
 
 
Post #: 3
 
 Re: How to stop/start a service on a local machine - 2/18/2005 3:53:38 PM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
The link gives you some options. Anyone who has used tcqrunas knows you can create a file with the admin user name and password in it. you can also hash it out.I'm not still comfotable with using these options and would like a better option myself. Users at my location only have rights to there desktop and c:\temp which is earased on a daily basis. Locked down to the max. We get a new software and I run sysprep filemon.exe and regmone.exe and give them the bear min. what they need "rights wise to run" hense virus comes out and we don't get hit.

(in reply to token)
 
 
Post #: 4
 
 Re: How to stop/start a service on a local machine - 2/19/2005 2:59:48 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Hey tnoonan, the link on google doesn't seem to work;it displayed an empty page on both IE and firefox. Any ideas ?

Thanks

(in reply to token)
 
 
Post #: 5
 
 Re: How to stop/start a service on a local machine - 2/20/2005 3:34:56 AM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
not working for me either..

am also quite interested to see how to do this.

does this mean that the password will be written in clear text? security?

I guess you could parse the password on a per user basis.. maybe not.

Bushmen

(in reply to token)
 
 
Post #: 6
 
 Re: How to stop/start a service on a local machine - 2/20/2005 3:44:40 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
Sorry don't know what happend to that link. Will try to find it again. Here is another soultion.

http://www.adminscripteditor.com/editor/scriptpackager/

(in reply to token)
 
 
Post #: 7
 
 Re: How to stop/start a service on a local machine - 2/20/2005 4:41:16 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
OK heres that link again

http://groups.google.com/groups?selm=3E272913.27CBE26D%40hydro.com

(in reply to token)
 
 
Post #: 8
 
 Re: How to stop/start a service on a local machine - 2/20/2005 7:30:56 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
tnoonan: Kewl, I'll check it out. Thanks again.

bushmen: There are a couple problems with this. First of all, WMI doesn't allow you to use alternative credentials when connecting to the local machine, so that's not even an option (unless there are other ways around it). Secondly, if vbscript itself can't do this, another method will be through the help of cmd line. However, as you know, runas doesn't accept stdin. I spent 4 hours last night trying alternative methods of piping the password to the runas cmd but with no success (either throught vbscript itself or by cmd line). When that is solved, I'll need to find a way to hide userID and password. What I want to achieve is to do this using only vbscripts or built-in 2K/XP cmds, if possible. Due to company policies (which is controlled by the states), using 3rd party utilities *might* be difficult and I try to avoid that (again if possible).

(in reply to token)
 
 
Post #: 9
 
 Re: How to stop/start a service on a local machine - 2/20/2005 12:14:00 PM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
im leaning towards the scriptpackager. going to try there free download and see if with a hex editor If i can grap username and password. Need to make sure it's hard enough for above average user. Hacker proof not worried about. If someone is on our network and i dont know about it then I need to find a new job.

(in reply to token)
 
 
Post #: 10
 
 Re: How to stop/start a service on a local machine - 2/21/2005 1:41:16 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Take a look at AutoIT www.hiddensoft.com. This is a language that has the ability to compile a script into an exe, which can be encrypted. From this, you can call a Vbscript, even on the network, as long as the username used has rights to the folder on the network. Here is an example of a script that used to install XP and 2000's SP on users PC's.
AutoIT Script

      

(in reply to token)
 
 
Post #: 11
 
 Re: How to stop/start a service on a local machine - 2/21/2005 4:17:19 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Thanks tnoonan and mbouchard. I believed autoIT might just solve this problem. However, I'll still do some more testing as our unique situation gets more complicated than I first anticipated :D Again, I believe it's the best solution so far.

Thanks alot for your help guys; really appreciated.

Thanks.

(in reply to token)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to stop/start a service on a local machine Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts