I have a script similar to this running as a cgi script on my Local Web server. It Audits system settings and all seems to work fine except for the web audit stuff. I am trying to display the port settings for the web page. I.E. 80/8080 etc. If I terminal server into the system running the web site and execute the script in a dos window, it works fine. If it is executed from the web page, it fails opening the IIS://$Machine object.
If there something that keeps a script that is running under IIS from contacting an IIS Object on another server? BTW. The script makes a secure connection to the target server in the beginning of the script. I can include the script, but it is almost 2000 lines of code now. -----Original Message----- From: Iacoboni, Vince [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 8:29 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: Access the IIS metabase 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 _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
