Automatically Reset the FTP Service in Windows Server 2008

net stop msftpsvc
ping -n 10 127.0.0.1
net start msftpsvc
- Right-click Task Manager (under Configuration in Server Manager) and select Create a Basic Task
- Name the task, "Reset FTP Service" and click Next
- Choose When a specific event is logged as the Task Trigger, click Next
- Select Log: System, Source: IIS-FTP, and Event ID: 100. Click Next
- Select Start a program and click Next
- Enter C:\Scripts\ResetFTPService.bat for the Program/script and click Next
- Click the checkbox for Open the Properties dialog for this task when I click Finish and then click Finish
- In the Properties window select Run whether user is logged on or not and Run with highest privileges
- Click OK
- Enter the User name and Password for running this task
This causes the ResetFTPService.bat batch file to run whenever an event ID 100 with source IIS-FTP is logged in the System event log.
Remember, this will not work with the Microsoft FTP Publishing Service for IIS 7.0 because this service strangely does not log failed logon attempts to the event log. I've posted a request to the IIS7 team for this functionality.
Labels: Hacking, IIS, scripts, Security, tip, troubleshooting, Windows Server 2008


