ASP and ASP.NET website management tools

When problematic ASP.NET and ASP application exist, and you need to eliminate resource leaks, or initiate resource recycling.

Windows Management Instrumentation (WMI)

You can use WMI scripts for a few typical IIS management tasks:

A few WMI scripts are provided by Microsoft, and are located in the \Windows\System32 directory. These WMI scripts and their associated functions are listed below:

Active Directory Services Interface (ADSI)

Active Directory Services Interface (ADSI) was used in IIS 5 to manage IIS from the command line. Through ADSI, you can change IIS configuration settings, and configure websites, applications, and virtual directories from the command line. With IIS 6, it is recommended to use WMI scripts over ADSI. Any custom ADSI scripts previously used in IIS 5 should be tested to verify that they work in IIS 6.

Windows Commands and Support Tools Utilities

A few IIS specific Windows commands, such as the net commands, can be used to manage IIS from the command line:

You can also use the resource kit utilities listed below to manage certain elements of IIS:

How to schedule IISReset.exe through Task Scheduler

IISReset is typically used when you need to recover from faulty application situations. You can use Windows Task Scheduler to schedule IIS to restart according to predefined parameters.

  1. Open Control Panel.
  2. Select Scheduled Tasks, and then select Add Scheduled Task.
  3. Click Next for the Scheduled Task Wizard to start.
  4. Click Browse and browse to Windows\System32 folder.
  5. Double-click IISReset.exe.
  6. Enter a task name, and select when the task should run. Click Next.
  7. Enter the Administrator account details that should be utilized to run IISReset. Click Next.
  8. If you want to configure advanced task scheduling properties, click the Advanced checkbox; or alternatively click Finish.
  9. Open the Properties dialog box of the task you just configured, and click the Task tab.
  10. Add any additional switches in the Run box.
  11. Click OK.

How to use iisweb.vbs to manage Web sites

The iisweb.vbs utility is used to list Web sites, create and delete Web sites, and start and stop Web sites in IIS.

iisweb.vbs has the following main switches:

To create a Web site, use:

iisweb[.vbs] /create Path SiteName [/b Port] [/i IPAddress] [/d HostHeader] [/dontstart] [/s Computer [/u [Domain\]User [/p Password]]]

To start, stop, delete, or pause a Web site, use:

iisweb[.vbs] {/delete | /start | /stop | /pause} WebSite [WebSite...] [/s Computer [/u [Domain\]User [/p Password]]]

To query Web sites on your IIS servers, use

iisweb[.vbs] /query [WebSite [WebSite...]] [/s Computer [/u [Domain\]User [/p Password]]]

How to use iisvdir.vbs to manage virtual directories

The iisvdir.vbs command can be used to list virtual directories in a specified root, to create and delete virtual directories for websites, and to query virtual directories of an IIS server.

To create a virtual directory for a Web site, use:

iisvdir /create WebSite[/VirtualPath] Name PhysicalPath [/s Computer [/u [Domain\]User /p Password]]

To delete a virtual directory associated with a Web site, use:

iisvdir /delete WebSite[/VirtualPath] Name [/s Computer [/u [Domain\]User/p Password]]

To query Web site specific virtual directories on your IIS servers, use

iisvdir /query WebSite[/VirtualPath][/s Computer [/u [Domain\] User/p Password]]

How to use iisftp.vbs to manage FTP sites

The iisftp.vbs utility is used to perform management tasks from the command line that are specific to managing FTP sites on the IIS servers.

iisftp.vbs has the following main switches:

To create a FTP site, use:

iisftp /create Path SiteName [/b Port] [/i IPAddress] [/dontstart] [/isolation {AD|Local} [/domain DomainName /Admin [Domain\]User /AdminPwd Password]] [/s Computer [/u [Domain\]User/p Password]]

To start, stop, delete, or pause a FTP site, use:

iisftp[.vbs] {/delete | /start | /stop | /pause} FTPSite [FTPSite...] [/s Computer [/u [Domain\]User [/p Password]]]

To query FTP sites on your IIS servers, use

iisftp[.vbs] /query [FTPSite [FTPSite...]] [/s Computer [/u [Domain\]User [/p Password]]]

To use /setadprop, and /getadprop use,

iisftp /SetADProp UserID {FTPDir|FTPRoot} PropertyValue [/s Computer [/u [Domain\]User/p Password]]

iisftp /GetADProp UserID [/s Computer [/u [Domain\]User /p Password]]

How to use iisftpdr.vbsto manage virtual directories

The iisftpdr.vbs command can be used to list virtual directories in a specified root, and to create and delete virtual directories in FTP sites from the command line.

To create a virtual directory for a FTP site, use:

iisftpdr /create FTPSite[VirtualPath] Name PhysicalPath [/s Computer [/u [Domain\]User /p Password]]

To delete a virtual directory associated with a FTP site, use:

iisftpdr /delete FTPSite[VirtualPath]/Name [/s Computer [/u [Domain\]User /p Password]]

To query FTP specific virtual directories on your IIS servers, use

iisftpdr /query FTPSite[/VirtualPath][/s Computer [/u [Domain\]User/p Password]]

How to use iiscnfg.vbs to manage IIS from the command line

You can use iiscnfg.vbs to import and export IIS configurations settings of the metabase as XML files.

To export IIS configuration settings, use:

iiscnfg /export /f [Path\]FileName.xml /sp SourcePath [/d EncryptingPassword] [/inherited] [/children] [/s Computer [/u [Domain\]User [/p Password]]]

To import IIS configuration settings, use:

iiscnfg /import /f [Path\]FileName.xml /sp SourcePath /dp DestinationPath [/d EncryptingPassword] [/inherited] [/children] [/merge][/s Computer [/u [Domain\]User [/p Password]]]

To copy the metabase.xml file and metabase XML file to a different IIS server, use:

iiscnfg /copy /ts TargetComputer /tu TargetUser /tp TargetPassword [/s Computer [/u [Domain\]User [/p Password]]]

To immediately save configuration changes to the metabase, use:

iiscnfg /save [/s Computer [/u [Domain\]User /p Password]]

How to use iisback.vbs to back up IIS configuration settings and restore IIS configurations

You can use iisback.vbs to back up, and restore IIS configuration settings from the command line

To back up IIS configuration settings, use:

iisback /backup [/b BackupName] [/v {Integer | HIGHEST_VERSION | NEXT_VERSION}] [/overwrite] [/e EncryptingPassword] [/s Computer [/u [Domain\]User/p Password]]

To restore IIS configuration settings, use:

iisback /restore /b BackupName [/v {Integer | HIGHEST_VERSION}] [/e EncryptionPassword] [/s Computer [/u [Domain\]User/p Password]]

To list all IIS backups for an IIS server, use:

iisback /list [/s Computer [/u [Domain\]User/p Password]]

To delete an IIS backup, use:

iisback /delete [/bBackupName] [/v {Integer | HIGHEST_VERSION}] [/s Computer [/u [Domain\]User /p Password]]