I would like to read registry keys of remote computers but using different credentials of that ones as the local script is running.
I know that is possible to read remote keys using the RegRead() command by prepending the computername in front of the registry key, but this command does not allow to specify different credentials.
now I'm using a bit articulate way like this:
paexec.exe remotemachine -u remotemachineusername -p password reg query "HKEY_LOCAL_MACHINEkeypath" /V keyname
that
Try this:
Global Const $oErrorHandler = ObjEvent("AutoIt.Error", "ObjErrorHandler")
MsgBox(0, "Test", "Product Name: " & WMI_GetRemoteRegVal(@ComputerName, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") & @CRLF & _
"Error: " & @error)
Func WMI_GetRemoteRegVal($sHost, $sRegPath, $sUser = "", $sPass = "") ;coded by UEZ build 2016-10-25
If $sHost = "." Then $sHost = "localhost"
Local $bLocal = T