Login | |
|
 |
remote registry read (with alternate credentials) - 9/4/2006 12:04:09 PM
|
|
 |
|
| |
takeda kozo
Posts: 83
Score: 0
Joined: 11/9/2005
Status: offline
|
Hi all, I've used the microsoft script repository to locate the following example: strComputer = "atl-fs-01" strNamespace = "root\cimv2" strUser = "kenmyer" strPassword = "password" Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objwbemLocator.ConnectServer _ (strComputer, strNamespace, strUser, strPassword) Can anyone tell me how I could use this logic, above, to return registry key values on remote machines? (with alternate credentials) ? Basically, we have two different admin accounts which have read access to remote registry. If AdminAccount_1 fails (access denied) then I would like to run the below section of script with alternate credentials (AdminAccount_2) The section of my script currently looks like this: '+++++++++++++++++++++++++++++++++++ strCurrentUser = "" Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & Machine & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion" strValueName = "LoggedOnUser" oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath, strValueName,strCurrentUser Wscript.Echo strCurrentUser '+++++++++++++++++++++++++++++++++++
< Message edited by takeda kozo -- 9/4/2006 12:05:43 PM >
|
|
| |
|
|
|
|
|