Error handling

When setting object properties, HRESULT errors are returned if the property is invalid. If Policy Manager returns an error when calling EnableScript, DisableScript, or ExecuteScript, you can use the two properties available to help with tracing problems with the Provisioning API.

These properties are as follows:

ReportText

Returns the report text from the previous run.

LastScript

Returns the script from the previous run.

Table: Provisioning API error codes describes the standard set of errors that the API returns.

Table: Provisioning API error codes

Error code

Error type

Message text

0xC004C000

PROV_DIRECTORY_INVALID

The Directory Service name is invalid or the Directory Service is not running.

0xC004C001

PROV_MUST_SET_DIRECTORY _FIRST

The Directory property must be set first.

0xC004C002L

PROV_COULD_NOT_CREATE_ DIRECTORYCONNECTION

Could not create the Enterprise Vault Directory Connection object.

0xC004C003

PROV_ENTRYID_INVALID

The Entry Id is not valid.

0xC004C004

PROV_INVALID_TABLE_ID

Invalid table ID.

0xC004C005

PROV_ERROR_INSERTING_ PARAMETERS

An error occurred replacing the script parameters.

0xC004C006

PROV_INVALID_ARG_ PARAMETER

One of the arguments supplied in the arguments array could not be converted to a string.

0xC004C007

PROV_MUST_SET_SITE_FIRST

The Site property must be set before this property.

0xC004C008

PROV_NAME_INVALID

Invalid property value.

0xC004C009

PROV_INDEXING_SVC_NOT_FOUND

The Indexing Service could not be found.

0xC004C00A

PROV_NOT_ENOUGH_PROPERTIES_SET

The following properties must be set before Enable/Disable can be called: %n%nDirectory, Site, ExchangeServer, SystemMailbox, (MailboxDN or LDAPQuery).

0xC004C00B

PROV_FAILED_CREATE_STDIN_PIPE

Failed to create a StdIn pipe.

0xC004C00C

PROV_FAILED_CREATE_STDOUTERR_PIPE

Failed to create the StdOut pipe.

0xC004C00D

PROV_FAILED_DUPLICATE_HANDLE

Failed to duplicate the std handle.

0xC004C00E

PROV_FAILED_CLOSE_TEMP_HANDLE

Failed to close the temporary handle.

0xC004C00F

PROV_NO_PASSWORD_FOR_USER

The password for the Logon details was not set.

0xC004C010

PROV_CREATE_PROCESS_FAILED

Failed to create the policy manager process.

0xC004C011

PROV_CREATE_PROCESS_AS_USER_FAILED

Failed to create the policy manager process under the specified account.

0xC004C012

PROV_LOGON_USER_FAILED

Could not log the user on for the policy manager process.

0xC004C013

PROV_WAIT_SINGLE_OBJECT_FAILED

Failed to wait for the process to complete.

0xC004C014

PROV_GETEXITPROCESS_FAILED

Could not get the exit code from the policy manager process.

0xC004C015

PROV_FAILED_GET_TEMP_PATH

Could not get the temp file path.

0xC004C016

PROV_FAILED_GET_TEMP_FILE_NAME

Could not get the temp file name.

0xC004C017

PROV_FAILED_CREATE_INI_FILE

Could not create the provisioning initialization file.

0xC004C018

PROV_WRITE_WRITE_INI_FILE

Could not write the provisioning initialization file.

0xC004C019

PROV_FAILED_CLOSE_INI_FILE

Could not close the provisioning initialization file.

0xC004C01A

PROV_FAILED_COCREATE_POLICYINVOKER

Failed to connect to the Admin Service.

0xC004C01B

PROV_PARAMS_NOT_ARRAY

The second argument must be an array.

0xC004C01C

PROV_SCRIPT_FILE_NOT_FOUND

The Script file could not be found.

0xC004C01D

PROV_INPUT_FILE_NOT_UNICODE

Script file is not unicode.

0xC004C01E

PROV_FAILED_OPEN_REGISTRY

Could not open the Enterprise Vault Registry Key.

0xC004C01F

PROV_FAILED_READ_REGISTRY

Could not read the Installation directory from the registry.

0xC004C020

PROV_FAILED_EXECUTE

The script returned errors, check the report for details.

0xC004C021

PROV_SCRIPT_TIMED_OUT

The script timed out.

0xC004C022

PROV_FAILED_READ_LOGON_DETAILS

Failed to read the Logon Details.