IISComputer2::RestoreWithPassword
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.
HRESULT RestoreWithPassword(
BSTR bstrLocation,
LONG lVersion,
LONG lFlags,
BSTR bstrPassword
);
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 IISComputer2::BackupWithPassword method was invoked.
Return Value
Returns an HRESULT that contains one of the values listed in the table below. The errors that begin with "MD_" are owned by IIS and are defined in the Mdmsg.h header file. Other errors can also be returned that are passed through from the file system, or from a CryptoAPI when secure metabase data is being saved, or from registry operations.
Term |
Definition |
---|---|
E_INVALIDARG |
An argument was invalid. |
HRESULT_FROM_WIN32(ERROR_INVALID_DATA) |
The data is invalid. |
HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY) |
Insufficient memory to perform the operation. |
S_OK |
The method succeeded. |
MD_ERROR_INVALID_VERSION |
The specified version is invalid (0x800CC802L). |
MD_WARNING_INVALID_DATA |
Invalid metabase data (0x000CC805L). |
MD_WARNING_PATH_NOT_FOUND |
The specified path was not found (0x000CC803L). |
Requirements
Server: Requires Windows Server 2003.
Product: IIS
Header: Declared in iiisext.h; include iisext_i.c.
See Also
Concepts
Using ADSI to Configure IIS in a C++ Application