in reply to Win32::OLE lookup registry value on remote machine via WMI
Are you sure that the code posted is the code that you ran? The reason for asking is that I see your posted code is doing two things: a) loading modules and pragmas; and b) defining a subroutine. Unless I missed it somewhere, you didn't call the subroutine in your posted code.
Assuming that your actual code is calling the subroutine and it really is crashing the script, you might try encasing the call of the subroutine and/or that particular line of code checking the registry path inside an eval block to help trap the error and possibly get more details on the error.
One more thought. You mentioned that you wanted to "check for a registry value on a remote machine via WMI". I personally haven't done much with WMI, but generally speaking you need to provide credentials to access a remote system. If two Windows systems have local user accounts with identical username and password, you might be able to get by without supplying credentials since Windows will try you're logged in with on the local machine when accessing remote systems. Anyways, I'm not seeing credential information in your posted code, which might be a contributing factor.
One other thing that I'd check is to see if the remote registry service on the remote system is running. (Not sure if WMI utilizes that service or not.) Also, you might want to check firewall settings on the remote system.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::OLE lookup registry value on remote machine via WMI
by yankaxc (Initiate) on Jun 17, 2011 at 14:01 UTC |