We needed a method to have a listing of the staff memebers on our Aliases lists. The following script:
- Mounts the remote drive.
- Reads the information out of the *.lst files.
- Displays this in an easy to read format.
use Win32::OLE;
# Editing a list has been turned off. Lines 25 and 39 have been commented out.
# Using the same format as below, add any additional Domain Names located on mail.evenlink.com.
@directories = ("Evenlink.com", "LMF.net", "NBN.net", "Micro-Link.net");
$objNetwork = Win32::OLE->new('WScript.Network');
$objNetwork->MapNetworkDrive('P:', '\\\\10.X.X.X\\mail', 0, 'XXXXXXXXXXX\\xxxxxxxx', 'XxXxXxXx');
print Win32::OLE->LastError();
print "
Group Aliases
";
print "Group Aliases:
";
foreach $directory (@directories) {
print " $directory
";
}
print "
Please send any list addition requests to some\@address.com.
";
# print "Exsisting lists can be edited from this page.
";
foreach $directory (@directories) {
print "";
$directory = "P:\\IMail\\" .$directory;
opendir(DIR, "$directory" );
@nfiles = grep(/\.*lst/,readdir(DIR));
closedir(DIR);
@files = sort @nfiles;
foreach $file (@files) {
# print "" .substr($file, 0, -4) ." (edit)
";
print "" .substr($file, 0, -4) ."
";
open (aliases, "$directory\\$file");
$alias = ;
chomp($alias);
while ($alias) {
if ( ($alias ne "root") ) {
print " $alias
";
}
$alias = ;
} # end displaying file contents
close (aliases);
} # end displaying fime names.
print " top";
} # end displaying directory contents.
$objNetwork->RemoveNetworkDrive('P:', 1, 0);
print Win32::OLE->LastError();
print "
";