Здравствуйте D,

Thursday, May 11, 2006, 3:23:44 PM, Вы написали:

DDA> I've been trying to write a Perl script that uses the WMI OLE object 
DDA> "WbemScripting.SWbemRefresher" to access TCP statistics -- using the WMI 
DDA> performance counter class 
DDA> "Win32_PerfFormattedData_Tcpip_NetworkInterface".

DDA> I've got it working in VBScript "no issues".  But my Perl Win32::OLE 
DDA> translation bombs out with an "Access Denied" OLE exception from 
DDA> "SWBemRefresher" raised by the "AddEnum" call.   I use the same setup code 
DDA> in other WMI perl scripts that perform ExeQuery's -- that work.

DDA> VBScript and perl translation follow.

DDA> Anyone have any ideas?

DDA> Regards,

DDA> .. Dewey


     Just replace in

Win32::OLE->GetObject('winmgmts:{impersonationLevel=impersonate}!//' .
$strComputer . '/root/cimv2');

all slaches with double backslash. You'll get

Win32::OLE->GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\' .
$strComputer . '\\root\\cimv2');

and script will work. I've got such output:

c:\crow_works>perl netmon.pl
*********
(32) Name: Realtek RTL8139 Family PCI Fast Ethernet NIC
Total Bytes Per Second: 34662
Bytes Sent Per Second: 12233
Bytes Received Per Second: 22428
Packets Per Second: 453
Packets Sent Per Second: 226
Packets Received Per Second: 226



-- 
С уважением,
 Сергей                            mailto:[EMAIL PROTECTED]


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to