Enable FTP authentication (Perl)

This code can be found in Chapter 15 of Windows Server 2003 Security Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the Perl code from this site.

# This enables authentication to the default FTP site.
# ------ SCRIPT CONFIGURATION ------

use Win32::OLE;

$strComputer = '<ServerName>';
$strSiteID = '<SiteID>';
# ------ END CONFIGURATION ---------
$objFtpSite = Win32::OLE->GetObject('IIS://' . $strComputer . '/MSFTPSVC/' . $strSiteID);
$objFtpSite->{AllowAnonymous} = 0;
$objFtpSite->SetInfo();

print 'Successfully modified Anonymous settings for: ' . $objFtpSite->ServerComment, "\n";

This code has been viewed 913 times.

New from the creators of TechTasks.com: StatSheet.com