ISSUE: Step fails with error 'Key not valid for use in specified state'

Last modified:


Overview

A step fails with the error below. 


Key not valid for use in specified state

Image 248

The complete error from the Exchange log is below:

2023-10-05T13:23:18|INFO |xyz |192.168.140.254|T:69 |GraphExecutionBase`2 |user1@mydomain.com ||1654 |6e74f2d1-96a6-4227-b0f8-3fe808d5acaa| ||Starting Command: [AssignLicenseWithGraph] | Id: [6e74f2d1-96a6-4227-b0f8-3fe808d5acaa]
2023-10-05T13:23:19|ERROR|xyz |192.168.140.254|T:69 |GraphExecutionBase`2 |user1@mydomain.com ||1654 |6e74f2d1-96a6-4227-b0f8-3fe808d5acaa| ||An error occurred for AssignLicenseWithGraph - user1@mydomain.com/1654
EXCEPTION: System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.

at System.Security.Cryptography.ProtectedData.Unprotect(Byte[] encryptedData, Byte[] optionalEntropy, DataProtectionScope scope)
at cloudficient.EVComplete.Module.Exchange.Executors.MigrationProcessSteps.GraphExecutionBase`2.GetAADClient(String credentialName) in e:\_w\o\1\6\s\EV2O365.OnPrem.Exchange\Executors\MigrationProcessSteps\GraphExecutionBase.cs:line 92
at cloudficient.EVComplete.Module.Exchange.Executors.MigrationProcessSteps.Execute_AssignLicense_WithGraph.d__6.MoveNext() in e:\_w\o\1\6\s\EV2O365.OnPrem.Exchange\Executors\MigrationProcessSteps\Execute_AssignLicense_WithGraph.cs:line 0
--- End of stack trace from previous location where exception was thrown ---

Cause

This occurs when modifying and/or creating entries in the Credential Editor while logged onto the server as an account other than the service account running the Cloudficient services. The credential editor can only be used while logged in as this account. 

Solution

Log onto the server as the service account running the Cloudficient services and recreate the entries.  If you are unsure which account this is, refer to the services control panel by reviewing the services that begin with "Remad.".  


Is this article helpful for you?