Programatically starting and stopping the SNMP service from a User account
I have a need to control the SNMP service from a user account. I considered using the Runas command but cannot get beyond the need to provide the administrator account password. Can you tell me what command line is needed to programmatically do this? I've looked at the /savecred switch but it doesn't seem to get me around the problem. I'm running Windows 7 Professional on this system. Thank you Tom Eilert
January 11th, 2011 8:33am

i think the only way you can do this is by specifying admin credentials. Or trying to create a batch file, which will have the username and pw in clear text.Ok, so I changed my name...you can still call me Tom if you like. It's a...jump...to conclusions...mat. My Blog Site: http://tmagnuson.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
January 11th, 2011 9:18am

The cmd / batch approach is ok, but the password in clean text is bad. You can create a task in the task scheduler and start the cmd (or the net.exe with argument stop <Servicename>) which can be run whether the admin is logged on or not. Select the user with admin rights and type in the password. Next start the task with the command line: C :\ Windows \ System32 \ schtasks . exe / RUN / TN "TASKNAME" André "A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
January 11th, 2011 11:25am

I agree, clear text password is bad. It was more of a warning than a legitimate suggestion. Task scheduler would work quite well, it's a powerful tool I often forget about.Ok, so I changed my name...you can still call me Tom if you like. It's a...jump...to conclusions...mat. My Blog Site: http://tmagnuson.wordpress.com
Free Windows Admin Tool Kit Click here and download it now
January 11th, 2011 11:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics