There's some examples in Dave Roth's book Win32 Perl Scripting.  Highly
Recommended.  Here's a sample:

#  IISProperty.pl
#  Example 9.12:
#  ----------------------------------------
#  From "Win32 Perl Scripting: Administrators Handbook" by Dave Roth
#  Published by New Riders Publishing.
#  ISBN # 1-57870-215-1
#
#  This script sets a property in a web server.
#
print "From the book 'Win32 Perl Scripting: The Administrator's Handbook' by
Dave Roth\n\n";


use Getopt::Long;
use Win32;
use Win32::OLE qw( in );

Configure( \%Config );
push( @ARGV, Win32::DomainName() ) if( ! scalar @ARGV );
foreach my $Machine ( @ARGV )
{
  my $ADsPath = "IIS://$Machine";
  if( my $IIS = Win32::OLE->GetObject( $ADsPath ) )
  {
    ProcessObject( $IIS );
  }
}

sub ProcessObject
{
  my( $Object ) = @_;
  local $PropertyName;
  my $fDirty = 0;

  print "\n$Object->{ADsPath}\n";
  foreach my $Property ( sort( keys( %{$Config{prop}} ) ) )
  {
    my $Value = $Config{prop}->{$Property};
    next unless( defined $Object->{$Property} );

    if( $Config{set} )
    {
      print "  Setting '$Property' => '$Value'\n";
      $Object->{$Property} = $Value;
      $fDirty = 1;
    }
    else
    {
      print "  $Property: $Object->{$Property}\n";
    }
  }
  $Object->SetInfo() if( $fDirty );
}

sub Configure
{
    my( $Config ) = @_;
    my $Result;
    Getopt::Long::Configure( "prefix_pattern=(-|\/)" );
    $Result = GetOptions( $Config,
              qw(
                prop|p=s%
                set|s
              ) );
  return();
}

> -----Original Message-----
> From: Chuck Lee [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 5:53 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Access the IIS metabase
> 
> 
> Do you have any specific sample code for accessing the 
> metabase through
> Win32::OLE?  I'm not very familiar with VB concepts so any 
> help would be
> appreciated.
> 
> thanks
> Chuck


This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. 


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

Reply via email to