I can't say about error in this script but how to go for doing these things
on remote systems u can look at
www.roth.nt/perl/scripts/
www.tc.cornell.edu/services/edu/topics/Performance/Monitoring/more.asp
www.winscriptingsolutios.com/Articles/

( I have typed links - so could have spelling mistake etc) - better google
for -
use Win32::OLE  SWbemLocator
 or google for
use Win32::OLE   Win32_ComputerSystem
for very usefull scripts .

Thanks

Pradeep Goel
HP,Bangalore
080-2052262

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 24, 2003 5:50 PM
Subject: (no subject)


> Hallo All,
> please help ---> which are wrong ?
> I want read and write the registry into many remote computers and I can
not
> my own read !
> --------------------------------------------------------------------------
--
> -------------------------------------------------------
> use warnings;
> use strict;
> $|++;
> use Win32::OLE('in');
> use Win32::OLE::Variant;
> my $HKEY_LOCAL_MACHINE =0x80000002;
> my @pc = ( '' ) ;
> Win32::OLE->Option ('Warn' => 3);
> foreach  my $server (@pc) {
> my $Locator = Win32::OLE->new('WbemScripting.SWbemLocator') or
> die "Kann Locator-Object nicht erzeugen:
> ".Win32::OLE->LastError()."\n";
> $Locator->{Security_}->{impersonationLevel} = 3;
>
> my $Service = $Locator->ConnectServer($server,'root\default') or
> die "Kann Server-Object nicht erzeugen:
> ".Win32::OLE->LastError()."\n";
> my $reg = $Service->Get("StdRegProv") or
> die "Kann REg-Object nicht erzeugen:
> ".Win32::OLE->LastError()."\n";
> my $a = Variant (VT_ARRAY|VT_UI1,VT_EMPTY);
> my $sPath = 'HARDWARE';
> print STDOUT $reg->EnumKey("$HKEY_LOCAL_MACHINE",$sPath,$a);
> # This print a 0 for ok ! ?
> print STDOUT '*' x 80,"\n",$a;
> # This print nothing (only 80 x *)
> print STDOUT '*' x 80,"\n",@$a->Get;
> # This print nothing (only 80 x *)
> }
> --------------------------------------------------------------------------
--
> --------------------------------------------------------------------------
--
> ----------------
> Mit freundlichen Gr�ssen
> Joachim G�rner
>
> Information Technology Systemintegration (ITS)
> ADAC e.V., Am Westpark 8, 81373 M�nchen
> Tel.: (089) 76 76 27 83 Fax: (089) 76 76 34 22
> mailto:[EMAIL PROTECTED]
> www.adac.de
>
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to