Solved

Script to restart print spooler with elevated permissions

Posted on 2009-05-05
3
1,220 Views
Last Modified: 2012-05-06
I need a script that will restart the print spooler service on an XP machine (which I guess is easy enough), but is there a way to do this with elevated permissions (like 'Run As') embedded into the script??

0
Comment
Question by:Craig_Campbell
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
ALaRiva earned 250 total points
ID: 24310406
You won't be able to do it exactly as you are thinking, because that would involve placing the password directly into the script, and even encoding it would not be secure.

Try this link - http://www.eggheadcafe.com/forumarchives/scriptingVisualBasicscript/Aug2005/post23120632.asp

It offers a few suggestions that might work for you.

HTH
- Anthony
0
 
LVL 12

Assisted Solution

by:zoofan
zoofan earned 250 total points
ID: 24310456
You can not embed username and password for runas into vbscript only way Ive seen this done is using sendkeys.  But there are other options


use psexec  http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Same question as well..
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_23462238.html



*Best I think(but depends on your network)
Or provide a user/group the security to restart just the spooler service.
http://windowsitpro.com/article/articleid/75979/jsi-tip-4673-how-do-i-allow-users-to-start-stop-and-pause-a-windows-2000--windows-xp-service.html


zf


0
 
LVL 12

Expert Comment

by:zoofan
ID: 24310465
Sorry Anthony, didn't refresh the question to see your post after researching...

zf
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question