Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 29128

Setting and retrieving Date Encryption key programmatically in CRM 2013

$
0
0

System admin can manage Date Encryption through Settings à Data Management à Data Encyrption area.

To programmatically retrieve and update the Encryption key we can use the RetrieveDataEncryptionKeyRequest and SetDataEncryptionKeyRequest

RetrieveDataEncryptionKeyRequest retrieveDataEncryptionKeyRequest = newRetrieveDataEncryptionKeyRequest();

IOrganizationService organizationService = RetrieveOrganizationService();

RetrieveDataEncryptionKeyResponse retrieveDataEncryptionKeyResponse =

(RetrieveDataEncryptionKeyResponse)organizationService.Execute(retrieveDataEncryptionKeyRequest);

MessageBox.Show(retrieveDataEncryptionKeyResponse.EncryptionKey);

 

SetDataEncryptionKeyRequest setDataEncryptionKeyRequest = newSetDataEncryptionKeyRequest();

setDataEncryptionKeyRequest.ChangeEncryptionKey = true;

setDataEncryptionKeyRequest.EncryptionKey = "Pass@word1";

SetDataEncryptionKeyResponse setDataEncryptionKeyResponse =

(SetDataEncryptionKeyResponse) organizationService.Execute(setDataEncryptionKeyRequest);

 

Cheers,

Shraddha Dhingra


Viewing all articles
Browse latest Browse all 29128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>