The Import method imports a section of an IIS metabase from an export file that has been created on the same IIS server or a different IIS server. Machine-specific and system-Specific information is not present the export file.

      LPCWSTR pszPasswd,
      LPCWSTR pszFileName,
      LPCWSTR pszSourcePath,
      LPCWSTR pszDestPath,
      DWORD dwMDFlags


  • pszPasswd
    [in] Required only when the export file was encrypted when it was created. Specifies the password that was used to encrypt the export file.

  • pszFileName
    [in] Required. Specifies the path and file name of the XML source file.

  • pszSourcePath
    [in] Required. Specifies the location in the XML file of the keys being imported. Enter the metabase path as it appears in the XML file. To import all of the keys in the source file, enter the metabase path of the root key.

  • pszDestPath
    [in] Required. Specifies the metabase path into which the keys are placed. Enter the metabase path as it appears in the XML file. The imported key must be of the type expected in its new position in the metabase path. If the key is not of the expected type, the configuration will not operate properly. For example, do not import the event logging configuration (/LM/Logging) to a Web site configuration path, such as /LM/W3SVC/3. If you specify a path that already exists in the metabase, the imported keys overwrite and replace the keys currently in that metabase path, without warning.

  • dwMDFlags
    [in] A constant that specifies what inherit and merge flags to set. The constant can be one of the following.




    Adds the inherited properties of the exported keys to the export file. Without this flag, the export file does not include properties inherited from higher-level keys. If you use this flag, the Export method adds the inherited properties of the exported keys to an IIsInheritedProperties key in the export file. When you import keys from this file, you can elect to import the inherited properties with the keys.


    Prevents the subkeys of the specified key from being added to the export file.


    Combines keys in the XML file with the existing metabase keys. Without this parameter, the keys in the XML file replace existing keys in the same metabase path. The IMPORT_EXPORT_MERGE flag adds keys to the metabase that appear only in the XML file, retains keys in the metabase that are not in the XML file, and applies the values in the XML file when a key appears in both the XML file and the metabase.


Client: Requires or Windows XP Professional.

Server: Requires or Windows Server 2003.

Product: IIS

Header: Declared in iadmw.h; include iiscnfg.h.