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
Solved

Script to restart print spooler with elevated permissions

Posted on 2009-05-05
3
1,223 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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