One of my clients needed to provide an FTP server service on some of its XP PCs, but as an addition to the existing standard operating environment (i.e without altering the core build). Of course, Internet Information Services (including the FTP Publishing service) may be installed as part of an unattended Windows installation, but the problem here was installing IIS after the operating system had been installed and configured.I did some research, and discovered the system standalone optional component manager (
sysocmgr.exe). This is effectively what sits behind the Add or Remove Programs Control Panel applet (
appwiz.cpl), to provide the Add/Remove Windows Components functionality. Microsoft’s IIS 6.0 technical reference provided the appropriate information to write an answer file and this command file demonstrates the process, taking input from a text file.
Once IIS was installed, the next stage was to configure the FTP Publishing service (create virtual directories, set permissions, etc.). Scripting support varies across the different IIS versions with, not surprisingly, IIS 6.0 providing the most complete support for what I wanted to do (there are a number of IIS-related scripts in the %systemroot%\system32 directory). Unfortunately the IIS 6.0 scripts do not work with previous versions of IIS, the IIS 5.x administration scripts, installed by default in c:\inetpub\adminscripts) did not seem to offer what I needed, and the IIS 4.0 Resource Kit scripts do not work with IIS 5.0 or 5.1.
I was stumped until a contact at Microsoft pointed me in the direction of
adsutil.vbs. This is one of the IIS 5.x administration scripts that I had overlooked because of the filename (which does not imply that it will allow you to create virtual directories etc.). In fact,
adsutil.vbs is pretty comprehensive in its capabilities and allowed me to configure all the FTP site settings I wanted, as demonstrated in this command file.
The main issue (not immediately apparent from the
adsutil.vbs help text) was to create the virtual directory object and then to set the path for the virtual directory as two separate commands. This wasn’t easy to track down (but can be found in a Google Groups thread) and was the final step needed to get everything working.