Microsoft IIS Reviews

Using IIS Command-Line Utilities to Manage IIS

Using IIS Command-Line Utilities to Manage IIS

The Kinds of Instructions used to Handle IIS from the Command Line

The forms of instructions that handle IIS from the command line are:

  • IISReset, Home windows Administration Instrumentation (WMI) scripts, Lively Listing Providers Interface (ADSI), and the usual Home windows instructions and Help Instruments utilities.

IISReset Command-line Utility

IISReset is a command-line utility that has been in existence from IIS 5 that can be utilized to cease IIS, restart IIS, and reboot the IIS server. Typical causes for restarting IIS are:

  • When problematic ASP.NET and ASP purposes exist and useful resource leaks must be eradicated, or to provoke useful resource recycling.
  • When sure IIS configuration modifications are made, customers have to restart IIS in order that the modifications are utilized. A number of of a lot of these configuration settings modifications are listed under:
    • IIS must be restarted when the IIS isolation mode is modified.
    • When a metabase from a metabase historical past file is restored manually, restart IIS.
    • Restart IIS when the Direct Metabase Edit function’s property is modified, EnableEditWhileRunning, immediately within the metabase file.
    • IIS additionally needs to be restarted each time modifications are made to any international configuration settings situated underneath HKLMSoftwareMicrosoftInetMgrParameters.

Home windows Administration Instrumentation (WMI)

Use WMI scripts for a number of typical IIS administration duties:

  • Create and delete web sites and FTP websites
  • Create and delete digital directories
  • Allow/disable net service extensions
  • Backup and restore IIS configuration and replica IIS configuration
  • Import/export parts of the metabase in addition to different administration duties

Microsoft supplies a couple of WMI scripts and they’re situated within the WindowsSystem32 listing. These WMI scripts and their related features are listed under:

  • iisweb.vbs: Performs the next administration duties from the command line:
    • Record Web pages
    • Create/delete Websites
    • Begin/cease Websites
  • iisvdir.vbs: Performs the next administration duties from the command line:
    • Create/delete digital directories for Web pages.
    • Listing digital directories in a specified root.
  • iisapp.vbs: Lists all Net purposes operating on the IIS machine.
  • iisback.vbs: Backs up and restores IIS configuration settings and deletes IIS backups.
  • iiscnfg.vbs: Performs the next administration duties from the command line:
    • Import and export IIS configurations as XML information.
    • Save IIS configuration to disk.
    • Copy IIS configuration settings.
  • iisext.vbs: Performs the next administration duties from the command line:
    • Record purposes
    • Allow purposes
    • Add/take away software dependencies
    • Allow/disable net service extensions
    • Listing and add/take away net service extension information
    • Allow/disable net service extension information
  • iisftp.vbs: Performs the next administration duties from the command line:
    • Listing FTP websites
    • Create/delete FTP websites
    • Begin/cease FTP websites
    • Set Lively Listing consumer isolation on your FTP websites
  • iisftpdr.vbs: Performs the next administration duties from the command line:
    • Create and delete digital directories in FTP websites.
    • Listing digital directories in a specified root.

Lively Listing Providers Interface (ADSI)

Lively Listing Providers Interface (ADSI) was utilized in II 5 to handle IIS from the command line. By way of ADSI, customers can change IIS configuration settings and configure web sites, purposes, and digital directories from the command line. With IIS 6, it is suggested to make use of WMI scripts over ADSI. Any customized ADSI scripts beforehand utilized in IIS 5 ought to be examined to confirm that they work in IIS 6.

Home windows Instructions and Help Instruments Utilities

A number of IIS particular Home windows instructions, similar to the web instructions, can be utilized to handle IIS from the command line:

  • internet begin and internet cease: Used to start out and cease IIS providers. The service identify that must be used when using the web command to start out or cease IIS providers are listed under:
    • FTP service = msftpsvc
    • IIS Admin service = iisadmin
    • NNTP service = nntpsvc
    • SMTP service = smtpsvc
    • WWW service = w3svc
  • internet localgroup: provides a consumer account to the IIS_WPG group. Accounts utilized as software pool identities are members of the IIS_WPG group.
  • Cacls: Captures NTFS permissions on the IIS server.
  • Convlog: Converts the IIS log information to the NCSA format.

Customers also can use the useful resource package utilities listed under to handle sure parts of IIS:

  • secedit: Used to manage safety templates.
  • auditpol: Used to vary audit insurance policies from the command line.
  • showmbrs: Used to record the members of safety teams which have permissions on directories and information.

The right way to Schedule IISReset.exe by way of Process Scheduler

IISReset is usually helps customers to get well from defective software conditions. Customers can use Home windows Activity Scheduler to schedule IIS to restart in response to predefined parameters.

  1. Open Management Panel.
  2. Choose Scheduled Duties then choose Add Scheduled Activity.
  3. Click on Subsequent for the Scheduled Activity Wizard to start out.
  4. Click on Browse and browse to WindowsSystem32 folder.
  5. Double click on IISReset.exe.
  6. Enter a process identify and choose when the duty ought to run. Click on Subsequent.
  7. Enter the Administrator account particulars that must be utilized to run IISReset. Click on Subsequent.
  8. To configure superior process scheduling properties, click on the Superior checkbox or click on End.
  9. Open the Properties dialog field of the duty simply configured and click on the Process tab.
  10. Add any further switches within the Run field.
  11. Click on OK.

The way to Use iisweb.vbs to Handle Web pages

The iisweb.vbs utility is used to listing Websites, create and delete Websites, and begin and cease Web pages in IIS.

iisweb.vbs has the next fundamental switches:

  • /create, for making a Site.
  • /delete, for deleting a Site.
  • /begin, for beginning a Website online.
  • /cease, for stopping a Website.
  • /pause, for pausing a Website.
  • /question, for troubleshooting a Website online – displaying all of the Web pages on the IIS machine.

To create a Site, use:

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

  • Path – the bodily location to the information for the Website online. When the listing doesn’t exist, the script creates it.
  • SiteName – the identify of the brand new Site. That is the identify that can be displayed in IIS Supervisor.
  • /b Port – the port on which the brand new Website online ought to pay attention for HTTP requests. The default worth is port 80.
  • /i IPAddress – the IP handle that have to be assigned to the Site.
  • /d HostHeader – the host header for the brand new website.
  • /dontstart – used to point that IIS shouldn’t routinely begin the Site after it’s created. IIS by default begins a newly created Site.
  • /s Pc – used to point that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to create the web site on the distant pc.
  • /p Password – the password of the account credentials (above).

To start out, cease, delete, or pause a Site, use:

iisweb[.vbs] /delete | /begin | /cease | /pause WebSite [WebSite…] [/s Computer [/u [Domain]Consumer [/p Password]]]

  • WebSite – the identify of the web site that ought to be deleted, began, stopped, or paused.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to delete, begin, cease, or pause the web site on the distant pc.
  • /p Password – the password of the account credentials (above).

To question web sites on IIS servers, use

iisweb[.vbs] /question [WebSite[WebSite…]] [/s Computer [/u [Domain]Consumer [/p Password]]]

The way to Use iisvdir.vbs to Handle Digital Directories

The iisvdir.vbs command can be utilized to record digital directories in a specified root to create and delete digital directories for web sites and to question digital IIS server directories.

To create a digital listing for an internet site, use:

iisvdir /create WebSite[/VirtualPath] Identify PhysicalPath [/s Computer [/u [Domain]Consumer /p Password]]

  • WebSite – the identify of the web site that the digital listing will probably be created for.
  • VirtualPath – the digital path underneath which this digital listing must be created (non-compulsory).
  • Identify – the identify of the brand new digital listing.
  • PhysicalPath – the identify of bodily listing the place the digital listing factors.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer- the account credentials that have to be used to create the digital listing for the distant pc.
  • /p Password – the password of the account credentials (above).

To delete a digital listing related to a Site, use:

iisvdir /delete WebSite[/VirtualPath] Identify [/s Computer [/u [Domain]Consumer/p Password]]

  • WebSite – the identify of the Website online that’s related to the digital listing to be deleted.
  • VirtualPath – the digital path that holds the digital listing (non-compulsory).
  • Identify – the identify of the digital listing to be deleted.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to delete the digital listing.
  • /p Password – the password of the account credentials (above).

To question web site particular digital directories on IIS servers, use

iisvdir /question WebSite[/VirtualPath][/s Computer [/u [Domain] Consumer/p Password]]

  • WebSite – the identify of the web site that’s related to the digital listing to be queried.
  • VirtualPath – the digital path that holds the digital listing (non-compulsory).
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to question for digital directories.
  • /p Password – the password of the account credentials (above).

Learn how to Use iisftp.vbs to Handle FTP Websites

The iisftp.vbs utility performs administration duties from the command line which are particular to managing FTP websites on the IIS servers.

iisftp.vbs has the next foremost switches:

  • /create, for making a FTP website.
  • /delete, for deleting a FTP website.
  • /begin, for beginning a FTP website.
  • /cease, for stopping a FTP website
  • /question, for troubleshooting a FTP website – displaying all of the FTP websites on the IIS machine.
  • /setadprop, for indicating that Lively Listing properties must be used for a specific consumer accessing the FTP website.
  • /getadprop, for acquiring Lively Listing properties for the actual consumer.

To create an FTP website, use:

iisftp /create Path SiteName [/b Port] [/i IPAddress] [/dontstart] [/isolationNative[/domainDomainName/Admin[Domain]Consumer /AdminPwd Password]] [/s Computer [/u [Domain]Consumer/p Password]]

  • Path, the bodily location to the information for the FTP website.
  • SiteName, the identify of the brand new FTP website. That is the identify that will probably be displayed in IIS Supervisor.
  • /b Port, the port on which the brand new FTP website ought to pay attention for FTP requests. The default worth is port 21.
  • /i IPAddress, the IP tackle that have to be assigned to the FTP website.
  • /dontstart, used to point that IIS shouldn’t routinely begin the FTP website after it’s created. IIS by default begins all newly created websites.
  • /isolation, used to point the isolation mode that must be used.
  • area, when Lively Listing is chosen because the isolation mode, that is the area for Lively Listing.
  • admin, when Lively Listing is chosen because the isolation mode, that is the admin account credentials for Lively Listing.
  • AdminPwd, when Lively Listing is chosen because the isolation mode, that is the password of the admin account for Lively Listing (above).
  • /s Pc, used to point that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer, the account credentials that have to be used to create the FTP website on the distant pc.
  • /p Password, the password of the account credentials (above).

To start out, cease, delete, or pause an FTP website, use:

iisftp[.vbs] /delete | /begin | /cease | /pause FTPSite [FTPSite…] [/s Computer [/u [Domain]Consumer [/p Password]]]

  • FTPSite – the identify of the FTP website that ought to be deleted, began, stopped, or paused.
  • /s Pc, used to point that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer, the account credentials that have to be used to delete, begin, cease, or pause the FTP website on the distant pc.
  • /p Password, the password of the account credentials (above).

To question FTP websites on the IIS servers, use

iisftp[.vbs] /question [FTPSite[FTPSite…]] [/s Computer [/u [Domain]Consumer [/p Password]]]

To make use of /setadprop, and /getadprop use,

iisftp /SetADProp UserID FTPRoot PropertyValue [/s Computer [/u [Domain]Consumer/p Password]]

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

  • UserID – the Lively Listing consumer login ID.
  • FTPDir – signifies whether or not the modification is relevant on the listing degree or on the root degree.
  • PropertyValue – signifies the house listing and relative path.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used for distant administration.
  • /p Password – the password of the account credentials (above).

How you can Use iisftpdr.vbs to Handle Digital Directories

The iisftpdr.vbs command can be utilized to record digital directories in a specified root and to create and delete digital directories in FTP websites from the command line.

To create a digital listing for an FTP website, use:

iisftpdr /create FTPSite[VirtualPath] Identify PhysicalPath [/s Computer [/u [Domain]Consumer /p Password]]

  • FTPSite – the identify of the FTP website that the digital listing shall be created for.
  • VirtualPath – the digital path underneath which this digital listing ought to be created (non-compulsory).
  • Identify – the identify of the brand new digital listing.
  • PhysicalPath – the identify of bodily listing the place the digital listing factors.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to create the digital listing on the distant pc.
  • /p Password – the password of the account credentials (above).

To delete a digital listing related to an FTP website, use:

iisftpdr /delete FTPSite[VirtualPath]/Identify [/s Computer [/u [Domain]Consumer /p Password]]

  • FTPSite – the FTP website related to the digital listing to be deleted.
  • VirtualPath – the digital path that holds the digital listing (elective).
  • Identify – the identify of the digital listing to be deleted.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to delete the digital listing.
  • /p Password – the password of the account credentials (above).

To question FTP particular digital directories on IIS servers, use

iisftpdr /question FTPSite[/VirtualPath][/s Computer [/u [Domain]Consumer/p Password]]

  • FTPSite – the identify of the FTP website related to the digital listing  to be queried.
  • VirtualPath – the digital path that holds the digital listing (elective).
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to question for digital directories remotely.
  • /p Password – the password of the consumer account (above).

Tips on how to Use iiscnfg.vbs to Handle IIS from the Command Line

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

To export IIS configuration settings, use:

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

  • /f [Path]FileName.xml – the identify of the XML file that the configuration settings ought to be exported to.
  • /sp SourcePath – the node of the metabase configuration settings.
  • /d EncryptingPassword – the XML file’s password.
  • /inherited – signifies that each one inherited info ought to be exported.
  • /youngsters – signifies that node subkeys must be exported.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to run the script.
  • /p Password – the password of the account credentials (above).

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]Consumer [/p Password]]]

  • /f [Path]FileName.xml – the identify of the XML file that ought to be used to import IIS configuration settings to the server.
  • /sp SourcePath – the node of the XML file.
  • /dp DestinationPath – the vacation spot node path within the metabase.
  • /d EncryptingPassword – the XML file’s password.
  • /inherited – signifies that each one inherited info ought to be imported. This could solely happen when the supply node has properties that may be inherited.
  • /youngsters – signifies that node subkeys ought to be imported.
  • /merge – merges totally different supply keys to at least one metabase key by means of this worth.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to run the script.
  • /p Password – the password of the consumer account (above).

To repeat the metabase.xml file and metabase XML file to a special IIS server, use:

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

  • /ts TargetComputer – the identify or IP tackle of the IIS pc to which these configuration settings must be copied.
  • tu TargetUser – the consumer account for logging onto the goal pc.
  • tp TargetPassword – the password of the account offered above.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to run the script remotely.
  • /p Password – the password of the account (above).

To right away save configuration modifications to the metabase, use:

iiscnfg /save [/s Computer [/u [Domain]Consumer /p Password]]

  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to run the script.
  • /p Password – the password of the account (above).

Easy methods to Use iisback.vbs to Again Up IIS Configuration Settings and Restore IIS Configurations

Use iisback.vbs to again up and restore IIS configuration settings from the command line.

To again up IIS configuration settings, use:

iisback /backup [/b BackupName] [/v HIGHEST_VERSION ] [/overwrite] [/e EncryptingPassword] [/s Computer [/u [Domain]Consumer/p Password]]

  • /b BackupName, the identify of the again up.
  • /v Integer, attainable values are HIGHEST_VERSION or NEXT_VERSION. HIGHEST_VERSION creates a backup of the very best model quantity. The HIGHEST_VERSION worth needs to be utilized with /overwrite. NEXT_VERSION increments the prevailing model quantity by one.
  • /overwrite – overwrites a present backup.
  • /e EncryptingPassword – allows password encryption for the backup.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to create backups for the distant pc.
  • /p Password – the password of the account credentials (above).

To revive IIS configuration settings, use:

iisback /restore /b BackupName [/v HIGHEST_VERSION] [/e EncryptionPassword] [/s Computer [/u [Domain]Userp Password]]

  • /b BackupName – the identify of the backup file to be restored.
  • /v Integer, potential values are HIGHEST_VERSION or NEXT_VERSION.
  • /e EncryptingPassword – the password for the backup.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to revive the backup file for the distant pc.
  • /p Password – the password of the account (above).

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

iisback /record [/s Computer [/u [Domain]Consumer/p Password]]

  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to listing all backups for the distant pc.
  • /p Password – the password of the account credentials (above).

To delete an IIS backup, use:

iisback /delete [/bBackupName] [/v HIGHEST_VERSION] [/s Computer [/u [Domain]Consumer /p Password]]

  • /bBackupName – the identify of the backup file to be deleted.
  • /v Integer, attainable values are HIGHEST_VERSION or NEXT_VERSION.
  • /s Pc – signifies that the script ought to run on this distant pc. The native pc is utilized by default.
  • /u [Domain]Consumer – the account credentials that have to be used to delete the backup file for the distant pc.
  • /p Password – the password of the account credentials (above).

About the author

Admin