Saving Configurations to Disk Using Iiscnfg.vbs
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
You can use the command-line script iiscnfg.vbs, which is stored in systemroot\System32, to immediately save configuration changes to disk. Administrators can use this script tool to make changes immediately visible in the metabase.xml.
Iiscnfg.vbs performs the same backup and restore operations that are available in IIS Manager. You can use either tool to view and manage backup copies.
Important
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any parameters).
This topic includes the following information:
Overview: Key concepts in understanding the backup and restore procedures.
Syntax: The order in which you type a command and any arguments and options that follow it.
Parameters: The values that are given to variables in the command.
Examples: Sample code and an explanation of the results.
Overview
Any changes that are made to the metabase, whether by using scripts or IIS Manager, are written to memory first and to disk at the next scheduled update, which might be several minutes later. As a result, an administrator might make metabase changes and then open metabase.xml only to find the changes aren't reflected. The /save command in iiscnfg.vbs resolves the problem by saving changes to the disk immediately.
Syntax
iiscnfg /save*[*/s Computer [/u [Domain\]User /p Password]]
Parameters
/s Computer
Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. The default is the local computer.
/u [Domain\]User
Runs the script with the permissions of the specified user account. This account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user of the local computer.
/p Password
Specifies the password of the user account that is specified in the /u parameter.
Examples
Example 1:
The following command saves the IIS configuration to disk on the local computer:
iiscnfg /save
In response, iiscnfg displays the following message:
Configuration saved
Example 2:
The following command saves the IIS configuration to disk on the local computer:
iiscnfg /save /s SourceServer /u Administrator /p Kj30W
In response, iiscnfg displays the following message:
Configuration saved
Related Information
For information about copying IIS configurations, see Copying IIS Configurations Using Iiscnfg.vbs.
For information about importing IIS configurations, see Importing IIS Configurations Using Iiscnfg.vbs.
For information about exporting IIS configurations, see Exporting IIS Configurations Using Iiscnfg.vbs.