The GetDataPaths part of this lists anywhere that the AuthAnonymous Flag
is set.
So, if you are only interested in SMTP Stuff, change AuthAnonymous to
SMTPLocalNDRExpireMinutes (really only looking for a property that only
an SMTP service would have).
And
for(my $i=0; $i<scalar(@$PathList); $i++){
$smtppath = Win32::OLE->GetObject($$PathList[$i]));
print "comment: ".$smtppath->{ServerComment}."\n";
print "State: ".$smtppath->{ServerState}."\n";
print "Domain: ".$smtppath->{DefaultDomain}."\n";
}
>From there, you have access to all the properties as shown above for
ServerComment, ServerState, and DefaultDomain.
Get a good ADSI viewer like the IIS Metabase Explorer to look at what's
available to you in the IIS Metabase.
Then you can see what is avaliable graphically. The path you would pass
to the Metabase viewer is the ADsPath that GetDataPaths sends you.
Good Luck.
Steven
-----Original Message-----
From: John Serink [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 01, 2006 12:02 AM
To: Steven Manross; Paul Sobey;
[email protected]
Subject: RE: MS SMTP and MS FTP server information
Hi Steven:
Ok cool, I got it going with this:
use Win32::OLE qw (in);
use strict;
use warnings;
my $IIS = Win32::OLE->GetObject("IIS://johnathlonxpm");
my $PathList = $IIS->GetDataPaths("AuthAnonymous",0);
print("$PathList");
print("\n");
my $thislong = scalar(@$PathList);
print("This long is $thislong\n");
for(my $i=0; $i<scalar(@$PathList); $i++){
print("$$PathList[$i]\n");
if($$PathList[$i]=~/smtp/i){
print("This one\n");
}
}
This prints our all the paths.
How do I enumerate the smtp paths? That is, how do I get a listing of
all ther perameter settings?
Cheers,
John
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Steven Manross
> Sent: Saturday, December 31, 2005 10:46 AM
> To: Paul Sobey; [email protected]
> Subject: RE: MS SMTP and MS FTP server information
>
>
> Use an ADSI editor like the IIS 6 Metabase Explorer, ADSVW or others..
>
> The metabase is stored here:
>
> IIS://SERVERNAME
>
> >From there you can do all sorts of cool stuff...
>
> I use it to do some SOX auditing of IIS settings..
>
> Realtime access and every possible setting is exposed via this
> interface.
>
> Perl can access it as well via the same interface.
>
> Please forgive me if there are typos.
>
> -------------
>
> use Win32::OLE qw (in);
>
> my $IIS = Win32::OLE->GetObject("IIS://Servername");
> $PathList = IIS->GetDataPaths("AuthAnonymous",0);
>
> foreach $Path (in $PathList) {
> if ($Path eq "IIS://" . $strSrv .
> "/W3SVC/Info/Templates/Secure Web Site/Root" ||
> $Path eq "IIS://" . $strSrv . "/W3SVC/Info/Templates/Public Web
> Site/Root") {
> #Do nothing.. these are templates
> } else {
> $iisnode = Win32::OLE->GetObject($Path);
> if ($iisnode->{AuthAnonymous} == 1) {
> print $strSrv . " -- AUTHANONYMOUS -- " . $Path."\n";
> }
> }
> }
>
> Steven
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Paul Sobey
> Sent: Wednesday, December 28, 2005 7:59 AM
> To: [email protected]
> Subject: RE: MS SMTP and MS FTP server information
>
> > How can I find this stuff with Perl?
> > I need to dump the SMTP and ftp settings, what MS calls properties,
> > from a machine for a report but the setup is done using IIS
> with GUIs.
> >
> > Anyone know how to do this? Where to get the information from? I've
> > scoured the registry and can't find where Gates' hides it.
>
> Depends on which version of IIS you mean. IIS 6 stores its info in a
> plain xml file, system32\inetsrv\metabase.xml. You can open this and
> play with standard tools, although you need to configure IIS to allow
> edits while running, or shutdown IIS, before making changes. You
> should find most of what you need in there. Alternatively, you could
> check out the ADSI/WMI providers:
>
> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003
> /Library/I
> IS/43a51d34-7c81-413b-9727-ec9a19d0b428.mspx
>
> IIS 5 is not as easy since the metabase is a proprietry binary format,
> but there are still command line/COM interfaces to management I think.
>
> I've never used any of this stuff but it looks promising.
>
> Cheers,
> Paul
>
> *****************************************************************
> Gloucester Research Limited believes the information provided herein
> is reliable. While every care has been taken to ensure accuracy, the
> information is furnished to the recipients with no warranty as to the
> completeness and accuracy of its contents and on condition that any
> errors or omissions shall not be made the basis for any claim, demand
> or cause for action.
>
> The information in this email is intended only for the named
> recipient. If you are not the intended recipient please notify us
> immediately and do not copy, distribute or take action based on this
> e-mail.
>
> Gloucester Research Limited, 5th Floor, Whittington House, 19-30
> Alfred Place, London WC1E 7EA
> *****************************************************************
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs