Hi wonderful people
 
I hope one of you can help me.  I need to access WMI on a remote Win XP
desktops and I am getting permission errors when using the local admin
account on the remote box.  Any ideas?
 
CODE:
 
use DBI;
my $machine = 'server';
my $dbh = DBI->connect('dbi:WMI:'.$machine,'admin','admin');
  print "$dbh\n";
my $sth = $dbh->prepare('SELECT * FROM Win32_OperatingSystem');
$sth->execute;
while (my @row = $sth->fetchrow) {
    my $printer = $row[0];
    printf "ServicePackMajorVersion is %s\n",
$printer->{ServicePackMajorVersion}, $machine;
    printf "ServicePackMinorVersion is %s\n",
$printer->{ServicePackMinorVersion}, $machine;
};

ERROR:
 
C:\Scripting\toys>wmi.pl
Win32::OLE(0.1707) error 0x80070005: "Access is denied"
    after character 0 in "winmgmts:\\server\root\cimV2" at
C:/Perl/site/lib/DBD/
WMI.pm line 95

Any help greatly appreciated.
 
Thanks
 
Dave
 
PS
My system is...
Host: WinXP SP2
Perl: 5.8.8 Build 822
DBD::WMI 0.06
DBI 1.607
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to