I need to access the WMI remotely and get a few attributes
I found the following script in
use vars qw( $Log $Message $Name $Value );
use strict;
use Win32::OLE qw( in );
my @OS_TYPE = qw(
Unknown Other Mac_OS ATTUNIX DGUX DECNT Digital_Unix
OpenVMS HPUX AIX MVS OS400 OS/2 JavaVM MSDOS
Windows_3x Windows_95 Windows_98 Windows_NT Windows_CE
NCR3000 NetWare OSF DC/OS Reliant_UNIX SCO UnixWare
SCO_OpenServer Sequent IRIX Solaris SunOS U6000 ASERIES
TandemNSK TandemNT BS2000 LINUX Lynx XENIX VM/ESA
Interactive_UNIX BSDUNIX FreeBSD NetBSD GNU_Hurd OS9
MACH_Kernel Inferno QNX EPOC IxWorks VxWorks MiNT
BeOS HP_MPE NextStep PalmPilot Rhapsody
);
# BEGIN CALLOUT A
my $Class = "Win32_OperatingSystem";
(my $Machine = shift @ARGV || "." ) =~ s/^[\\\/]+//;
# next is the part that fails
my $WMIServices = Win32::OLE->GetObject(
"winmgmts:{impersonationLevel=impersonate,(security)}//$Machine"
) || die "$!" ;
...
I call the script with
perl script.pl 10.100.65.68
(ip of the remote),
but it dies on the last statement -without any error messages. Anyone know what could be wrong here?
I found the following script in
use vars qw( $Log $Message $Name $Value );
use strict;
use Win32::OLE qw( in );
my @OS_TYPE = qw(
Unknown Other Mac_OS ATTUNIX DGUX DECNT Digital_Unix
OpenVMS HPUX AIX MVS OS400 OS/2 JavaVM MSDOS
Windows_3x Windows_95 Windows_98 Windows_NT Windows_CE
NCR3000 NetWare OSF DC/OS Reliant_UNIX SCO UnixWare
SCO_OpenServer Sequent IRIX Solaris SunOS U6000 ASERIES
TandemNSK TandemNT BS2000 LINUX Lynx XENIX VM/ESA
Interactive_UNIX BSDUNIX FreeBSD NetBSD GNU_Hurd OS9
MACH_Kernel Inferno QNX EPOC IxWorks VxWorks MiNT
BeOS HP_MPE NextStep PalmPilot Rhapsody
);
# BEGIN CALLOUT A
my $Class = "Win32_OperatingSystem";
(my $Machine = shift @ARGV || "." ) =~ s/^[\\\/]+//;
# next is the part that fails
my $WMIServices = Win32::OLE->GetObject(
"winmgmts:{impersonationLevel=impersonate,(security)}//$Machine"
) || die "$!" ;
...
I call the script with
perl script.pl 10.100.65.68
(ip of the remote),
but it dies on the last statement -without any error messages. Anyone know what could be wrong here?