vbscript - Can't query windows 7 registry remotely using WMI -
i used following vb script query registry value remotely using wmi. able connect, couldn't value.
option explicit dim strcomputer dim struser, strpassword dim objswbemlocator, objswbemservices, objreg dim strkeypath, strentryname, strvalue const hkey_local_machine = &h80000002 strcomputer = "192.168.1.10" struser = "username" strpassword = "password" set objswbemlocator = createobject("wbemscripting.swbemlocator") set objswbemservices = objswbemlocator.connectserver _ (strcomputer, "root\default", struser, strpassword) set objreg = objswbemservices.get("stdregprov") strkeypath = "system\currentcontrolset\services\eventlog\application" strentryname = "maxsize" objreg.getdwordvalue hkey_local_machine, strkeypath, strentryname, dwvalue wscript.echo dwvalue
it returns: microsoft vbscript runtime error: variable undefined: 'dwvalue'. means didn't value target machine. checked on target machine, dword value exist.
i configured target machine follows
- turned off firewall
- run "wmimgmt.msc" -> wmi control -> properties enabled "remote enable" namespaces , sub namespaces users.
- started service "remote registry"
i spent days on problem , couldn't figure out. please me check whether script has problem or it's configuration of target machine. thank much.
Comments
Post a Comment