I've spent the whole day finding ways to automate the "enable logging" on all IIS sites. I found a lot of good stuff (both on this site and some others), but not quite what I need. I'm new to IIS, so feel free to correct my logic here.
I've found several ways to enable/disable logging on the default website but not a way to enumerate all sites and to enable/disable logging on all of them.
My target audience is Server 2003 with IIS 6 and Server 2008 with IIS 7. I'm aware of the adsutil.vbs for IIS6 and AppCmd.exe for IIS7, but I can't seem to get either of them to enumerate all sites. Ideally, I'd like to use WMI or a CmdLet method that will work on both versions. I feel like I'm missing something very obvious and I'm going to kick myself when I hear the solution. :)