• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

Run a script as a non-admin


I need to be able to change proxy settings on a Windows 2008 Enterprise x64 server with regularity.

I have written two scripts, and when logged in as Administrator they run fine.

When I try to run the script as a normal user (or another user who has admin privelegaes) the proxy doesn't get changed.

I don't get any error message stating insufficient privelges - it APPEARS that the script executes normally. But when I start IE the proxy settings are unchanged.

I am also unable to get the script to work as a logon script - presumably for same reason.

How can I set it such that this script can be run by any normal user?

1 Solution
I assume you are changing registry keys?  If so which keys are you changing?
MDWinterAuthor Commented:
Yes I am. The script is attached (I stole it from the internet, so I'm not suer EXACTLY what it does...)

The script is attached for reference...
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"
strValueName = "ProxyEnable"
dwValue = 1
objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue
strValueName = "ProxyServer"
strValue = "vw:80"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue
strValueName = "ProxyOverride"
strValue = "<local>; www.anglopacific.co.uk"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue

Open in new window

Three points I would ask on this,

Is the administrator account logging in a local or a domain account?

Is there a GPO setting proxy settings for these other accounts that does not apply to the administrator account(domain or local)?


Is there a GPO in place making proxy settings machine specific -vs- user specific?
\\computer configuration\administrative templates\Internet explorer\make proxy settings per-machine

might also try a GPO results modeling on the admin account and one of the other user accounts run against the same pc (look at the difference's)
reaching for straws, hope they help.


Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now