Logon script with Administrator rights?

B

Brian Nielsen

Hi

I want to use a VB logon script to change the power options for a Windows
2000 workstation, like this script.

---------------------
set WshShell = createobject("wscript.shell")
strPowerScheme = WshShell.RegRead("HKCU\Control
Panel\PowerCfg\CurrentPowerPolicy")
WshShell.Run "PowerCFG /NUMERICAL /CHANGE " & strPowerScheme & "
/standby-timeout-ac 0" , 7
WshShell.Run "PowerCFG /NUMERICAL /CHANGE " & strPowerScheme & "
/standby-timeout-dc 0" , 7
---------------------

But now I've read somewhere that Group policy logon scripts are executed as
the user logging on.
This result is that the user doesn't have permission to execute the script.

Does anyone have an idea of how I can apply these settings to the user
logging on with a GPO, without
having to use "runas" or another tool where I have to hardcode the password?

Thanks in advance

/Brian
 
B

Buz [MSFT]

Can you assign the script in the machine portion of group policy, then it
should run in the local systems context.

Buz Brodin
MCSE NT4 / Win2K
Microsoft Enterprise Domain Support

Get Secure! - www.microsoft.com/security

This posting is provided "as is" with no warranties and confers no rights.

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
 
B

Brian Nielsen

The problem is that power settings are different from user to user.

But if it is possible to change the default power settings for a
workstation/server, then I could make the
changes already when my program is first installed. Then new users would be
created with these schemes
and I wouldn't have to worry about the workstations going into standby.

This question probably doesn't belong to this group, but I don't know where
I should ask it.

/Brian
 
B

Buz [MSFT]

If you take a box and load the ntuser.dat in the C:\docs and
settings\Default User and make changes and unload this hive, any new users
on this machine will get a profile created locally (unless they use roaming
profiles) based on the default settings stored in Default User profile.

Hope this helps, good luck.

Buz Brodin
MCSE NT4 / Win2K
Microsoft Enterprise Domain Support

Get Secure! - www.microsoft.com/security

This posting is provided "as is" with no warranties and confers no rights.

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top