Share via


IIsComputer.Export (ADSI)

The Export method exports a section of the IIS metabase to a file for importing to the same IIS server or a different IIS server. The export file does not include machine-specific or system-specific data such as certain paths, GUIDs, passwords, and accounts.

objIIsComputer.Export(
  bstrPassword As BSTR,
  bstrFilename As BSTR,
  bstrSourcePath As BSTR,
  lFlags As LONG
)

Parameters

  • bstrPassword
    [in] Encrypts the export file with the specified password. You can use any string as the password. The /d parameter creates a secure export file by encrypting the session key and secure properties with the specified password. You must provide the password to use the file in an /import operation. If you omit this parameter or omit the password argument, then the export file is encrypted with a blank password. As a result, only the secure properties are encrypted and any administrator can use the export file to import a metabase configuration.

  • bstrFilename
    [in] Required. Specifies a unique name and location for the export file. If you specify an existing file or if the directories in the path you specify do not exist, the method fails. Also, the file path must be local. When exporting a file from a remote computer, the bstrFilename parameter refers to a path on the remote computer.

  • bstrSourcePath
    [in] Required. Specifies the metabase keys to export. Enter a metabase path, including /LM/ROOT, to indicate the selected keys.

  • lFlags
    [in] A constant that specifies what inherit and merge flags to set. The constant can be one of the following, defined in the Mddefw.h header file.

    Term

    Value

    Definition

    MD_EXPORT_INHERITED

    0x00000001

    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.

    MD_EXPORT_NODE_ONLY

    0x00000002

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

Return Value

This method has no return values.

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