Share via


IIsComputer.RestoreWithPassword (ADSI)

The RestoreWithPassword method restores the metabase from a backup that was created with BackupWithPassword. If the backup was encrypted with a password, use the same password in this method. The restore operation stops all services dependent on the IIS Admin service (including all servers) until the restore has completed; then it restarts all services.

objIIsComputer.RestoreWithPassword(
  bstrLocation As BSTR,
  lVersion As LONG,
  lFlags As LONG,
  bstrPassword As BSTR
)

Parameters

  • bstrLocation
    [in] String containing the location. If an empty string is specified, the default backup location will be used.

  • lVersion
    [in] Long integer containing the version number to be assigned to the backup. Must be less than or equal to MD_BACKUP_MAX_VERSION (9999). Can be set to MD_BACKUP_NEXT_VERSION (0xffffffff) which automatically selects the next available version number. These constants are defined in the Mddefw.h header file.

  • lFlags
    [in] Reserved. Must be zero.

  • bstrPassword
    [in] Optional string that will be used to unencrypt the backup. This password must be the same as the one used when the IIsComputer.BackupWithPassword (ADSI) method was invoked.

Return Values

This method has no return values.

Example Code

<%  
  Dim ComputerObj, ComputerName  
  'Restore metabase on a different computer.  
  ComputerName = "MyOtherComputer" 
  'You can use LocalHost if running under Windows Script Host.  
  Set ComputerObj = GetObject("IIS://" & ComputerName)  
  'Restore the highest number version in MyBackups.  
  ComputerObj.RestoreWithPassword "MyBackups", MD_BACKUP_HIGHEST_VERSION, 0, "MyP@ssWOrd"  
%>  

Requirements

Client: Requires Windows XP Professional.

Server: Requires Windows Server 2003.

Product: IIS

See Also

Concepts

IIsComputer (ADSI)

Using ADSI to Configure IIS

Backing Up and Restoring the IIS Metabase