?
Solved

Script to restart print spooler with elevated permissions

Posted on 2009-05-05
3
Medium Priority
?
1,229 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

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

752 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