FTP Site Availability Check (for 2-state monitor in OpsMgr 2007/2012)

This sample PowerShell script checks a remote FTP site for avaiailability by connecting to the actual site and verifying the status code. The zip file download contains a script named with a _test suffix, designed for command line testing. The _prod version is designed for use in a two-state monitor using the OpsMgr 2007 R2 PowerShell modules.
This sample assumes your FTP site requires authentication. For anonymous access, simply change the user name to “anonymous” and provide an e-mail address in place of the password.
Link to the tutorial on the MS site is included in the script header.