ICertificateEnrollmentServerSetup::SetApplicationPoolCredentials method (casetup.h)

The SetApplicationPoolCredentials method specifies user account information for the application pool in which the Certificate Enrollment Web Service (CES) runs.


HRESULT SetApplicationPoolCredentials(
  [in] const BSTR bstrUsername,
  [in] const BSTR bstrPassword


[in] bstrUsername

A BSTR that contains the username for the account.

[in] bstrPassword

A BSTR that contains the account password.

Return value

Return code Description
The bstrUsername and bstrPassword arguments cannot be NULL or empty.
The ICertificateEnrollmentServerSetup object has not been initialized.

The ErrorString property value is set to "The setup object has not been initialized. Please initialize the setup object with the InitializeInstallDefaults method."


The SetApplicationPoolCredentials method determines whether the user credentials are valid and whether the account is a member of the IIS_IUSRS group. If an error is encountered, the ErrorString property can be set to any of the following:

  • "Setup is unable to obtain security information for the account."
  • "Setup is unable to check the membership of the account."
  • "The account is not a member of the local machine's IIS_IUSRS group."
  • "Fail to retrieve the DNS name of the computer."
  • "The account should be a domain account. Local account is not allowed."


Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header casetup.h
DLL Certocm.dll

See also