3.2.4.2.3 ImportXml (Opnum 9)

The ImportXml method imports objects into the configuration.

 [id(3), helpstring("method ImportXml")] HRESULT ImportXml(
   [in] BSTR bstrPMCXml,
   [in] BSTR bstrPolicyXml,
   [in] BSTR bstrCalendarXml,
   [in] BSTR bstrConditionalXml,
   [in] BSTR bstrMachineGroupXml,
   [in] BSTR bstrConfigurationXmls,
   [in] IMPORT_TYPE enumImportType
 );

bstrPMCXml: A string that specifies process matching criteria (PMC), in the form of a ProcessMatchingCriteriaCollection element (section 2.2.5.25). For an example, see ProcessMatchingCriteriaCollection example (section 4.2.21).

bstrPolicyXml: A string that specifies a resource policy, in the form of a PolicyCollection element (section 2.2.5.22).

bstrCalendarXml: A string that specifies a calendar, in the form of a CalendarsCollection element (section 2.2.5.11). For an example, see CalendarsCollection example (section 4.2.8).<37>

bstrConditionalXml: A string that specifies a conditional policy, in the form of a ConditionalPolicy element (section 2.2.5.12).

bstrMachineGroupXml: A string that specifies a machine group, in the form of a MachineGroup element (section 2.2.5.17).

bstrConfigurationXmls: A string that specifies a configuration to be loaded by the WSRM server, in the form of a ConfigurationFiles element (section 2.2.5.13).

enumImportType: An IMPORT_TYPE enumeration value (section 2.2.3.6) that specifies the mode in which to handle conflicting objects.

Return Values: This method returns 0x00000000 for success or a negative HRESULT value (in the following table or in [MS-ERREF] section 2.1.1) if an error occurs.

Return value/code

Description

0x00000000

S_OK

Operation successful.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0xC1FF0272

WRM_ERR_CAL_SCHEDULE_IN_USE

An existing schedule with the same name as the one in the supplied CalendarsCollection is currently in use with an existing calendar. The complete import process is canceled.<38>

0xC1FF0070

WRM_ERR_TAGS_NOT_IN_ORDER

The XML data that is maintained by the management service is invalid or cannot be processed.<39>

Additional IResourceManager2 interface methods are specified in section 3.2.4.2.