Share via


IISComputer2::SaveData

The SaveData method triggers IIS to create a set of history files (configuration data and schema) that back up the entire IIS metabase. History files can only be restored to the computer on which the files were created.

You must not have a handle open with write permission when you call this method, or the method will fail. The process waits for a few seconds for handles to close, so other processes with write handles open should not normally interfere with the save operation.

HRESULT SaveData();

Return Value

Returns an HRESULT that contains one of the following values:

Term

Definition

HRESULT_FROM_WIN32(ERROR_PATH_BUSY)

The path specified cannot be used at this time.

S_OK

The method succeeded.

File system error codes

See winerror.h for information about specific error codes.

Requirements

Server: Requires Windows Server 2003.

Product: IIS

Header: Declared in iiisext.h; include iisext_i.c.

Remarks

All data in the metabase is saved, including data written by other applications.

This method will fail and return HRESULT_FROM_WIN32(ERROR_PATH_BUSY) if there are any open write handles to the metabase.

Metabase configuration data and schema is saved when IIS shuts down, so you usually do not need to call this method. However, for critical data it is recommended that you call this method whenever appropriate for your application.

See Also

Concepts

IIS ADSI Provider Interfaces

Using ADSI to Configure IIS in a C++ Application

IIS Constants and Header Files

IISComputer Interface

IMSAdminBase

IMSAdminBase2