Solved

Script to restart print spooler with elevated permissions

Posted on 2009-05-05
3
1,216 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
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry Anthony, didn't refresh the question to see your post after researching...

zf
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now