Iisback.vbs: IIS backup management script
To view the command syntax, click a command:
iisback /backup
Syntax
Parameters
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
To back up the IIS configuration
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
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 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
Syntax
Parameters
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
To restore an IIS configuration
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
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
Syntax
Parameters
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
To delete a backup copy of the IIS configuration
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
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
Syntax
Parameters
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
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 Windows XP 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 |