
01-15-2012, 03:53 PM
|
|
Newcomer
|
|
Join Date: Aug 2010
Posts: 3
|
|
wmi to edit registry
|
Can someone help me to figure out how i can add credentials to my script i want to be able to add the following registy changes to another pc in my workgroup but want to run as an admin i know the admin username and password on the remote machine but dont know how to run the script as the administrator on the remote machine ps the username and password on my machine are differnt to remote machine and windows firewall is off on both machines
thanks for any help
Code:
HKEY_CURRENT_USER = &H80000002
strComputer = inputbox ("Enter Computer Name")
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "\SYSTEM\CurrentControlSet\Control\Terminal Server"
ValueName = "fDenyTSConnections"
strValue = inputbox ("Enter 00000000 to Enable RDP, 00000001 To Disable RDP")
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
|
|