Find management scripts for IIS 6.0

iisiis-6

I'm running Windows 2003 R2 and IIS 6.0 with web applications written in ASP.NET.

I am looking for good samples of scripts (.bat, .cmd, .VBS, or powershell) to allow me to:

For websites:

  • Create website
  • Verify if website exists
  • Delete website

For virtual directories:

  • Create virtual directory
  • Verify if virtual directory exists
  • Delete virtual directory

For application pools:

  • Create application pool
  • Verify if application pool exists
  • Delete application pool
  • Assigning website to application pool

thanks..

Best Answer

I answered a similar question the other day:

Automated creation of IIS websites (Stack Overflow)

You can use the System.DirectoryServices namespace directly from PowerShell as well as C#.