So I ran into a rather straight forward script request recently that turned into a ton of research for what is a very simple solution in the end. I needed to disable anonymous FTP on multiple XP machines. Now normally this wouldn’t have been an issue except that they are using version 5.1 of IIS.
Why is that a problem?
Well it wasn’t until IIS version 6.0 that WMI components were added. Generally finding support information for these types of tasks can be the lion share of the work anyway, and in this case; that was most certainly the outcome.
In the end I found a comprehensive list of IIS metabase properties (the original list read as if they were only accessible via WMI which I found later to be untrue) and I was free to begin exploring them all individually and building some very simple scripts to modify our server properties.
First, lets disable anonymous FTP since that’s what started us on this:
Set oFtpServer = GetObject("IIS://localhost/MSFtpsvc") oFtpServer.Put "AllowAnonymous", 0 oFtpServer.SetInfo
Now for our VDs I’d like to disable anonymous while utilizing the integrated windows authentication instead.
Set oWebServer = GetObject("IIS://localhost/W3SVC") owebserver.put "authflags", 4 owebserver.setinfo
Simple enough, instantiate the object, put a property change in, then commit the change. In these examples I’m setting the changes at the root, but it’s possible to drill them down to specific VDs by finishing the full path when instantiating.
Thankfully technet saved my behind after some digging, but here’s the list of Metabase Properties for anyone reading this who might find themselves at a point of frustration over dealing with legacy IIS installs.
Be sure to also familiarize yourself with the data types etc if this is new to you.