Read Registry on remote machines VbScript
Here is a simple code to read any part of the registry from any machine , provided you have admin rights on the target machine:
- Const HKEY_LOCAL_MACHINE = &H80000002
- Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "Machine Name" & "\root\default:StdRegProv")
- strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
- strValueName = "BU"
- oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
- msgbox strValue
Comments
Post a Comment