Share via


Iisback.vbs: IIS backup management script

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

Iisback.vbs: IIS backup management script

Creates and manages backup copies of the Internet Information Services (IIS) configuration (metabase and schema) of a remote or local computer. Administrators can use this script tool to create a backup copy of their IIS configuration, to restore an IIS configuration from a backup copy, and to list and delete backup copies.

To view the command syntax, click a command:

  • iisback /backup

  • iisback /restore

  • iisback /delete

  • iisback /list

iisback /backup

Creates a backup copy of the Internet Information Services (IIS) configuration (metabase and schema) of a remote or local computer.

Syntax

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

Parameters
  • /b BackupName
    Specifies the name of the backup copy. SampleBackup is the default.
  • /v {Integer | NEXT_VERSION | HIGHEST_VERSION}
    Specifies the version number of the backup copy. NEXT_VERSION is the default.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><strong>Value</strong></p></td>
<td><p><strong>Description</strong></p></td>
</tr>
<tr class="even">
<td><p><em>Integer</em></p></td>
<td><p>Specifies the version number of the backup copy.</p></td>
</tr>
<tr class="odd">
<td><p><strong>NEXT_VERSION</strong></p></td>
<td><p>Specifies the highest version number plus 1. <strong>NEXT_VERSION</strong> is the default.</p></td>
</tr>
<tr class="even">
<td><p><strong>HIGHEST_VERSION</strong></p></td>
<td><p>Reuses the highest version number. Because this option replaces a backup copy, the <strong>/overwrite</strong> parameter is required when using this value.</p></td>
</tr>
</tbody>
</table>
  • /overwrite
    Permits Iisback.vbs to replace an existing backup copy with the newly created backup copy. Without this parameter, commands to create a backup copy with the same name and version number as an existing backup copy fail.
  • /e EncryptingPassword
    Encrypts the backup copy with the specified password. You can use any string as the password.
The **/e** parameter creates a secure backup by encrypting the session key and secure properties with the specified password. Administrators must provide the password to use the backup in a **/restore** operation.

If you omit this parameter or omit the password argument, then the backup is encrypted with a blank password. As a result, only the secure properties are encrypted and any Administrator can use the backup copy to restore the metabase.
  • /s Computer
    Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. By default, the script runs on 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
  • /?
    Displays help at the command prompt.
Remarks
  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • The /v HIGHEST_VERSION parameter is valid only when previous versions of the file are stored on the computer. Otherwise, Iisback.vbs returns an error explaining that it cannot find a file to replace.

Examples

The following examples show how to use iisback /backup in specific situations.

To back up the IIS configuration

The following command creates a new backup copy of the IIS configuration on the local computer. It uses the /b parameter to assign the name ReskitBkp to the file.

iisback /backup/b ReskitBkp

In response, Iisback.vbs displays the following success message indicating that the backup copy has been created, and that the default version value, NEXT_VERSION, is assigned to the file. Because this is the first backup copy named ReskitBkp, Iisback.vbs assigns the version number 0 to the backup copy.

Backup ReskitBkp version NEXT_VERSION has been CREATED.

The new backup copy is displayed in the following list of backup copies on the server.

Backup Name                        Version #      Date/Time
========================================================================
ReskitBkp                          0              1/9/2001 5:00:04 AM

The ReskitBkp backup copy consists of two files, ReskitBkp.MD0, which contains the metabase, and ReskitBkp.SC0, which contains the schema. Both files are stored in the Systemroot\System32\inetsrv\MetaBack directory on the computer.

To create an encrypted backup copy of a remote IIS configuration

The following command creates a backup copy of the IIS configuration on the \\Svr01 remote server.

This command uses the /b parameter to assign the file name, Svr01bkp, to the backup copy and the /v parameter to specify the version number (15) of the new backup copy. To encrypt the session key in the backup copy, the command uses the /e parameter and password, 7W*48Hv6#.

The command also uses the /s parameter to provide the name of the remote computer, and the /u and /p parameters to run the script tool with the permissions of the user's Administrator account.

iisback /backup/b Svr01bkp/v 15/e 7W*48Hv6#/s svr01/u admin21/p Rrr3Qv7s

In response, Iisback.vbs displays the following success message:

Backup Svr01bkp version 15 has been CREATED.

This command created the Svr01bkp version 15 backup copy of the \\Svr01 IIS configuration and stored the data in the Svr01bkp.MD15 and Svr01bkp.SC15 files in the Systemroot\System32\inetsvr\MetaBack directory of the remote computer.

A list operation shows the backup copies stored on the remote server. The backup command created the final entry in the list.


Backup Name                        Version #      Date/Time
========================================================================
Asiasvr                              1          1/8/2001 9:18:25 PM
Svr01bkp                            11          1/3/2001 3:00:42 AM
Svr01bkp                            12          1/4/2001 3:00:12 AM
Svr01bkp                            13          1/5/2001 3:01:00 AM
Svr01bkp                            14          1/6/2001 3:00:00 AM
Svr01bkp                            15          1/9/2001 5:18:04 AM

Although it is not evident from the list, the session key in the backup copy is encrypted and you must provide the backup password, 7W*48Hv6#, to use the backup in a restore operation.

Also, note that the dates and times listed are in UTC, not the local time for the IIS server.

To replace a backup copy

The following command replaces the most recent backup copy of the local IIS configuration with a newer backup. You can use this command format to update the backup copy that you maintain for the server.

The command uses the /b parameter to specify the name of the backup copy. It uses the /v HIGHEST_VERSION parameter to direct Iisback.vbs to replace the latest version of the backup copy named CurrentBackup instead of creating a new version. It also uses the /overwrite parameter, which is required with /v HIGHEST_VERSION to permit Iisback.vbs to replace an existing backup.

iisback /backup/b CurrentBackup/v HIGHEST_VERSION/overwrite

In response, Iisback displays the following success message:

Backup CurrentBackup version 0 has been CREATED.

The command created new versions of the CurrentBackup.md0 and CurrentBackup.sc0 files, which replaced files with the same names.

iisback /restore

Replaces the current Internet Information Services (IIS) configuration (metabase and schema) settings on a local or remote computer with the configuration settings stored in a backup copy.

Syntax

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

Parameters
  • /b BackupName
    Required. Specifies the file name of the backup copy used in the restore operation.
  • /v {Integer | HIGHEST_VERSION}
    Specifies the version of the backup copy used in the restore operation. HIGHEST_VERSION is the default.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><strong>Value</strong></p></td>
<td><p><strong>Description</strong></p></td>
</tr>
<tr class="even">
<td><p><em>Integer</em></p></td>
<td><p>Specifies the version number of the backup copy.</p></td>
</tr>
<tr class="odd">
<td><p><strong>HIGHEST_VERSION</strong></p></td>
<td><p>Specifies the backup copy with the highest version number.</p></td>
</tr>
</tbody>
</table>
  • /e EncryptionPassword
    Provides the password for an encrypted backup copy.
When the session key in a backup copy is encrypted, you must provide its password to use the copy in a **restore** operation.
  • /s Computer
    Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. By default, the script runs on 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
  • /?
    Displays help at the command prompt.
Remarks
  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • Restore is a complex operation that can take several minutes to complete. A brief delay is normal for this operation.

  • During the restore operation, Web pages, FTP sites, and SMTP and NNTP services are temporarily stopped. They are automatically restarted when the operation completes.

Examples

The following examples show how to use iisback /restore in specific situations.

To restore an IIS configuration

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

To restore an IIS configuration from an encrypted backup copy

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. This command omits the /v parameter and uses the default value, HIGHEST_VERSION.

iisback /restore/b Svr01bkp

In response, Iisback.vbs displays the following error message, which indicates that the session key in the specified backup copy is encrypted and that the command did not provide the backup password required for the restore operation. This message appears when the required password is missing or incorrect.

Connecting to server ...Done.
The password specified is incorrect.       

The following version of the command adds the /e parameter and the backup password, 7W*48Hv6#:

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

In response, Iisback.vbs displays the following success message indicating that the IIS configuration is restored:

Backup Svr01bkp version HIGHEST_VERSION has been RESTORED.

iisback /delete

Deletes a backup copy of the Internet Information Services (IIS) configuration (metabase and schema) from a remote or local computer.

Syntax

iisback[.vbs] /delete /b BackupName /v {Integer | HIGHEST_VERSION} [/s Computer [/u [Domain**\]User [/p** Password]]]

Parameters
  • /b BackupName
    Required. Specifies the file name of the backup copy.
  • /v {Integer | HIGHEST_VERSION}
    Required. Specifies the version of the backup copy.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><strong>Value</strong></p></td>
<td><p><strong>Description</strong></p></td>
</tr>
<tr class="even">
<td><p><em>Integer</em></p></td>
<td><p>Specifies the version number of the backup copy.</p></td>
</tr>
<tr class="odd">
<td><p><strong>HIGHEST_VERSION</strong></p></td>
<td><p>Indicates the backup copy with the highest version number.</p></td>
</tr>
</tbody>
</table>
  • /s Computer
    Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. By default, the script runs on 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
  • /?
    Displays help at the command prompt.
Remarks
  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • The /u and /p command-line options are available only when you use /s. You must use /p with /u to provide the user's password.

  • The delete operation moves the specified backup copy files from the Systemroot\System32\inetsrv\MetaBack directory to the Recycle Bin. This operation does not affect files in the Systemroot\System32\inetsrv\MetaBack\History directory.

Examples

The following examples show how to use iisback /delete in specific situations.

To delete a backup copy of the IIS configuration

The following command deletes the Svr01bkp, version 0 backup copy. It uses the /b parameter to specify the Srv01bkp series and the /v parameter to specify the version number. Both parameters are required to identify the backup copy.

iisback /delete/b Svr01bkp/v 0

In response, Iisback.vbs displays the following message, indicating that the backup copy is deleted:

Backup Svr01bkp version 0 has been DELETED.

To delete multiple backup copies

This example demonstrates the use of a simple batch file command to delete a series of backup copies of the IIS configuration. You can use this command to delete old files from your archive. You can type the command at the command line or save it in a batch file.

For /L %%i in (0, 1, 15) do iisback /delete /b Svr01bkp /v %%i

This batch command deletes Svr01bkp versions 1 through 15 by issuing the iisback /delete command 15 times, once for each version.

For a more practical application, make the backup name and version numbers variable. Or, use a dir or iisback /list command to detect the backup with the lowest version number, and then append a command to delete the oldest backup copy (lowest version number) to each command to create a new backup copy.

iisback /list

Displays backup copies of the Internet Information Services (IIS) configuration (metabase and schema) stored on a remote or local computer.

Syntax

iisback[.vbs] /list [/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. By default, the script runs on 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 specified in the /u parameter. If you omit this parameter, the script prompts you for the password and obscures the text you type.
  • /?
    Displays help at the command prompt.
Remarks
  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • The /u and /p command-line options are available only when you use /s. You must use /p with /u to provide the user's password.

  • The list operation lists only the backup copies stored in the default location, Systemroot\System32\inetsrv\MetaBack. If you move the backup copy files to a different directory, then the backup copy does not appear in the list.

Examples

The following command lists the backup copies stored on the remote server Svr16. It uses the /s parameter to specify the server name, the /u parameter to specify the user's Administrator account, and the /p parameter to specify the password for the Administrator account.

Without parameters, the iisback /list command lists all backup copies stored on the local computer.

iisback /list/s Svr16/u Domain06\User1 /p R34*9W@4b

In response, Iisback.vbs displays all backup copies on Svr16. The date and time displayed are in UTC.

Backup Name                        Version #      Date/Time
========================================================================
Asiasvr                            0         12/8/2001 9:18:25 PM
Asiasvr                            1         1/14/2001 9:02:33 PM
Svr01bkp                            11          1/3/2001 3:00:42 AM
Svr01bkp                            12          1/4/2001 3:00:12 AM
Svr01bkp                            13          1/5/2001 3:01:00 AM
Svr01bkp                            14          1/6/2001 3:00:00 AM
Svr01bkp                            15          1/9/2001 5:18:04 AM
Remarks
  • Iisback.vbs performs the same operations that are available from IIS Manager. You can use either tool to view and manage backup copies.

  • Backup copies store only the metabase configuration and schema. They do not store and cannot be used to restore Web site content.

  • Iisback Requirements

    • The computer issuing the command must be running or a Windows Server 2003 operating system. The user must be a member of the Administrators group on any computer that the command affects.

    • The computer that the command affects must be a server running Windows Server 2003 with Internet Information Services (IIS) 6.0 or later.

  • Each backup operation creates two files, an .MDX file to store the metabase and an .SCX file to store the schema, where 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. For information about importing and exporting a metabase configuration file, search for Metabase Import/Export in IIS 6.0 Help.

  • To copy part of a metabase configuration from one system to another, use Iiscnfg.vbs: IIS configuration script.

  • Iisback.vbs displays a "Connecting to server" message while it connects to the IIS service on the specified computer. This message appears whenever you use Iisback.vbs, whether on a local or a remote computer.

  • To prevent unauthorized use of backup copies, IIS versions 5.1 and 6.0, and IISback.vbs let you encrypt the backup copy with a password. The password encrypts the session key which, in turn, encrypts all 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 and you cannot 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. Neither IIS 5.1 nor 6.0. support machine key encryption of backup copies.

  • Iisback.vbs displays the date and time in Coordinated Universal Time (UTC), not in the local time for the IIS server.

Formatting legend

Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

See Also

Concepts

Iisapp.vbs: IIS application query script
Iiscnfg.vbs: IIS configuration script
Iisext.vbs: IIS Web service extension script
Iisftp.vbs: IIS FTP site management script
IISFtpdr.vbs: IIS FTP directory script
Iisvdir.vbs: IIS virtual directory script
Iisweb.vbs: IIS Web site management script
Command-line reference A-Z
Command shell overview