Partager via


IHostedEmailAdaptor.ResetAdminCredential Method (String, String, IDictionary<String, String>)

 

Resets the management account credentials.

Namespace:   Microsoft.WindowsServerSolutions.HostedEmail
Assembly:  Wssg.HostedEmailBase (in Wssg.HostedEmailBase.dll)

Syntax

void ResetAdminCredential(
    string admin,
    string password,
    IDictionary<string, string> extendedParameters
)
void ResetAdminCredential(
    String^ admin,
    String^ password,
    IDictionary<String^, String^>^ extendedParameters
)
Sub ResetAdminCredential (
    admin As String,
    password As String,
    extendedParameters As IDictionary(Of String, String)
)

Parameters

  • admin
    Type: System.String

    The name of the administration account.

  • password
    Type: System.String

    The password for the administration account.

Remarks

This method is called when Enable is called to reset the management account credentials.

This method is designed for resetting the admin credentials, and is similar to Activate. When implementing this method, be sure to perform the following tasks:

  1. Verify the subscription information passed in the admin and password parameters, or other format credential information passed in through extendedParameters.

  2. Store the necessary password information for any upcoming call to Connect for this session. The reason is that the call to Connect does not have any parameters: any password information must be passed during the call to ResetAdminCredential.

Examples

The following code implements ResetAdminCredential. For the complete code sample, see Quickstart: Creating a Hosted Email Adapter.

public void ResetAdminCredential(string admin, string password, IDictionary<string, string> extendedParameters)
{
    if (!EmailService.VerifyAdminAccount(admin, password))
    {
        throw new HostedEmailAdaptorException(HostedEmailAdaptorErrorCode.AuthenticationFailure, null);
    }
    logManager.Log("ResetAdminCredential to admin: {0}", admin);
    CredentialManager.AdminUserName = admin;
    CredentialManager.AdminPassword = password;
}

See Also

IHostedEmailAdaptor Interface
Microsoft.WindowsServerSolutions.HostedEmail Namespace

Return to top