Restoring IIS Configurations Using Iisback.vbs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

You can use the command-line script iisback.vbs, which is stored in systemroot\System32, to restore the IIS configuration of a server.

Iisback.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

Each backup operation creates two files, an .MDx file to store the metabase and an .SCx file to store the schema, where the x is the version number of the backup copy. IIS and iisback.vbs store backup copy files in the systemroot\System32\inetsrv\MetaBack directory.

The metabase and schema of an IIS configuration include system-specific and session-specific properties. Do not copy or import the metabase or schema of one IIS server to another IIS server without modification. To copy all or part of a metabase configuration from one system to another, use Copying IIS Configurations Using Iiscnfg.vbs.

To prevent unauthorized use of backup copies, you can use IIS 5.1 or IIS 6.0, and iisback.vbs to encrypt the backup copy with a password. The password encrypts the session key which, in turn, encrypts all of the properties for which the secure attribute is set.

You can read an encrypted backup copy (only the session key and secure properties are encrypted), and you can delete the files. However, you cannot use the backup copy in a restore operation unless you provide the encrypting password. Also, you cannot remove the password encryption from a backup copy nor can you change the encrypting password.

If you do not use password encryption, the session key and secure properties are encrypted with a blank password, which prevents you from reading these values but allows any member of the Administrators group to restore the metabase from the backup copy. IIS 5.1 and IIS 6.0. do not support machine key encryption of backup copies.

Note

The /restore operation is a complex operation that can take several minutes to complete. A brief delay is normal for this operation. During /restore, Web pages, FTP sites, and SMTP and NNTP services are temporarily stopped. Service is restored when the operation completes.

Syntax

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

Parameters

/b BackupName

Specifies the name of the backup copy.

/v {Integer | HIGHEST_VERSION*}*

Specifies the version number of the backup copy. HIGHEST_VERSION is the default.

Integer Specifies the version number of the backup copy.

HIGHEST_VERSION

Specifies the backup copy with the highest version number.

/e Encryption Password

Provides the password of an encrypted backup copy. When the session key in a backup copy is encrypted, you must provide its password to use the copy in the /restore operation.

/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 restores the IIS configuration from the TestBkp, version 3 backup copy. It uses the /b parameter to specify the name of the backup copy and the /v parameter to specify the version.

iisback /restore /b TestBkp /v 3

In response, iisback displays the following success message, indicating that the IIS configuration is restored:

Backup TestBkp version 3 has been RESTORED.

To verify that the configuration is restored, compare the current configuration, which is stored in systemroot\System32\inetsrv\MetaBase.xml and MBSchema.xml, with the backup copy files, TestBkp.MD3 and TestBkp.SC3, in the systemroot\System32\inetsrv\MetaBack directory.

Example 2:

The following command restores the IIS configuration from the Svr01Bkp, version 15 backup copy. The /b parameter is required to specify the backup copy name and the /e parameter to specify the backup password, 7W*48Hv6#. This command omits the /v parameter and uses the default value, HIGHEST_VERSION.

iisback /restore /b Svr01Bkp /e 7W*48Hv6#

In response, iisback displays the following success message, indicating that the IIS configuration is restored:

Backup Svr01Bkp version HIGHEST_VERSION has been RESTORED.