Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script to restart print spooler with elevated permissions

Posted on 2009-05-05
3
Medium Priority
?
1,233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
ALaRiva earned 750 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 750 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

597 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