Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Administrator woes

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
GB
Hi

Ok I need to run cluster.exe as administrator from a script which means basically that I need to go to a command prompt and be able to do, for example:

cluster localhost /ver

If I run this from a normal command prompt I get access denied, but if I open the command prompt via the "run as administrator" context menu then it works fine. I understand why this is but I want to stop it.

So is there a way to auto-elevate? Or even assign the right to a assign to a particular user so that user can run cmd.exe as administrator without interference?

I can see that you can modify a shortcut to always run as administrator but I want to do this on the application file itself.

Any help?

Thanks
 
have you tried creating a secondary admiistrative acct and then run your script as follows;

cluster localhost /ver /runas:<administrative account>
 
you mean:

runas /user:administrator "cluster localhost /ver"

yes it works but requires a password, I don't want to run it as the administator account, i want to elevate "an" administrators account.

For example, if I change the administrator password, I don't want to have to fix every one of my scripts.

:S

any ideas?
 
If you go into group policy (or local machine policy for that server) and look under:

Computer Configuration --> Windows Settings --> Local Policies --> Security Options --> User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode

Change it from "Prompt for consent" to "Elevate without prompting".

That should do it.

________________________________________
CompTIA A+, Network+, Server+, Security+
MCSE:Security 2003
MCITP:Enterprise Administrator
 
yeh i have done that but all that does is make it so that it doesn't prompt when you elevate. Taking this prompt of doesn't actually elevate the privs itself, merely stops it from asking you when you right click and elevate.
 
There is some scripts in the resource kit that should be able to help you out with this.
 
Ah, I misunderstood you. I thought that you had a script that already elevated but that you didn't want the prompting to happen. Sorry about that.


________________________________________
CompTIA A+, Network+, Server+, Security+
MCSE:Security 2003
MCITP:Enterprise Administrator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top