I would like to have standard users execute a single script that will modify the registry as shown
below. at the moment the registry modifications only work when the script is executed using the admin account, can anyone help???:(
I would prefer to embed the admin user name and password if possible.
I've been looking at the runas command and playing with
WMI:
Set objLocator = CreateObject( "WbemScripting.SWbemLocator" )
Set objWMIService = objLocator.ConnectServer ( strComputer, "root/cimv2", strUser, strPassword )
objWMIService.Security_.impersonationlevel = 3:eek:
I
dont want to prompt for user input.
on error resume next
Dim objWMIService, objItem, objService
Dim colListOfServices, strComputer, strService, intSleep, rkeyval1,
strComputer = "."
intSleep = 5000
set SHELL = CreateObject("WScript.Shell")
rkeyval1 = "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\"
regval1 = rkeyval1 & "WUServer"
regval2 = rkeyval1 & "WUStatusServer"
Shell.RegWrite regval1,"http://wsussrv001", "REG_SZ"
Shell.RegWrite regval2,"http://wsussrv001", "REG_SZ"
' NB strService is case sensitive.
strService = " 'wuauserv' "
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ="_
& strService & " ")
For Each objService in colListOfServices
objService.StopService()
WSCript.Sleep intSleep
objService.StartService()
Next
wscript.echo "WINDOWS UPDATE SETTINGS MODIFIED"