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.
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) 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.
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:
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.
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:
/create
, for creating a Web site.
/delete
, for deleting a Web site.
/start
, for starting a Web site.
/stop
, for stopping a Web site
/pause
, for pausing a Web site
/query
, for troubleshooting a Web site - displaying all the Web sites on the IIS machine 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]]]
Path
, the physical location to the files for the Web site. When the directory does not exist, the script creates it.
SiteName
, the name of the new Web site. This is the name which will be displayed in IIS Manager.
/b Port
, the port on which the new Web site should listen for HTTP requests. The default value is port 80.
/i
IPAddress, the IP address that must be assigned to the Web site.
/d
HostHeader, the host header for the new site.
/dontstart
, used to indicate that IIS should not automatically start the Web site after it is created. IIS by default starts a newly created Web site.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to create the Web site on the remote computer.
/p Password
, the password of the account credentials (above). 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]]]
WebSite
, the name of the Web site which should be deleted, started, stopped, or paused.
/s Compute
r, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to delete, start, stop, or pause the Web site on the remote computer.
/p Password
, the password of the account credentials (above). To query Web sites on your IIS servers, use
iisweb[.vbs] /query [WebSite [WebSite...]] [/s Computer [/u [Domain\]User [/p Password]]]
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]]
WebSite
, the name of the Web site which you want to create the virtual directory for.
VirtualPath
, the virtual path under which this virtual directory should be created (optional)
Name
, the name of the new virtual directory.
PhysicalPath
, the name of physical directory where the virtual directory points.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to create the virtual directory for the remote computer.
/p Password
, the password of the account credentials (above). To delete a virtual directory associated with a Web site, use:
iisvdir /delete WebSite[/VirtualPath] Name [/s Computer [/u [Domain\]User/p Password]]
WebSite
, the name of the Web site which is associated with the virtual directory that you want to delete.
VirtualPath
, the virtual path which holds the virtual directory (optional).
Name
, the name of the virtual directory that you want to delete.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]Use
r, the account credentials that must be used to delete the virtual directory.
/p Password
, the password of the account credentials (above). To query Web site specific virtual directories on your IIS servers, use
iisvdir /query WebSite[/VirtualPath][/s Computer [/u [Domain\] User/p Password]]
WebSite
, the name of the Web site which is associated with the virtual directory that you want to query.
VirtualPath
, the virtual path which holds the virtual directory (optional).
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to query for virtual directories.
/p Password
, the password of the account credentials (above). 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:
/create
, for creating a FTP site.
/delete
, for deleting a FTP site.
/start
, for starting a FTP site.
/stop
, for stopping a FTP site
/query
, for troubleshooting a FTP site - displaying all the FTP sites on the IIS machine
/setadprop
, for indicating that Active Directory properties should be used for a particular user accessing the FTP site.
/getadprop
, for obtaining Active Directory properties for the particular user. 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]]
Path
, the physical location to the files for the FTP site.
SiteName
, the name of the new FTP site. This is the name which will be displayed in IIS Manager.
/b Port
, the port on which the new FTP site should listen for FTP requests. The default value is port 21.
/i IPAddress
, the IP address that must be assigned to the FTP site.
/dontstart
, used to indicate that IIS should not automatically start the FTP site after it is created. IIS by default starts all newly created sites.
/isolation
, used to indicate the isolation mode that should be used.
domain
, when Active Directory is selected as the isolation mode, this is the domain for Active Directory.
admin
, when Active Directory is selected as the isolation mode, this is the admin account credentials for Active Directory.
AdminPwd
, when Active Directory is selected as the isolation mode, this is the password of the admin account for Active Directory (above).
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to create the FTP site on the remote computer.
/p Password
, the password of the account credentials (above). 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]]]
FTPSite
, the name of the FTP site which should be deleted, started, stopped, or paused.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to delete, start, stop, or pause the FTP site on the remote computer.
/p Password
, the password of the account credentials (above). 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]]
UserID
, the Active Directory user login ID
FTPDir
, indicates whether the modification is applicable at the directory level or at the root level.
PropertyValue
, indicates the home directory and relative path.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used for remote administration.
/p Password
, the password of the account credentials (above). 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]]
FTPSite
, the name of the FTP site which you want to create the virtual directory for.
VirtualPath
, the virtual path under which this virtual directory should be created (optional)
Name
, the name of the new virtual directory.
PhysicalPath
, the name of physical directory where the virtual directory points.
/s Computer
, used to indicate that the script should run on this remote computer. The local computer is used by default.
/u [Domain\]User
, the account credentials that must be used to create the virtual directory on the remote computer.
/p Password
, the password of the account credentials (above). 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]]
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]]
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]]