Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Error in MR: Please create a master key in the database or open the master key in the session before performing this operation

(0) ShareShare
ReportReport
Posted on by

Please create a master key in the database or open the master key in the session before performing this operation. The 'DecryptData' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead. Originating procedure: DecryptData. Machine: DED3W1DYSLA02

  • Suggested answer
    CFROTON Profile Picture
    4,710 on at
    RE: Error in MR: Please create a master key in the database or open the master key in the session before performing this operation

    Hello Kenzie

    They need to create a Master Encryption key in the ManagementReporter database. They would use the attached script. The script has the instructions in it.

    If you have any issues you can create a case in MS Dynamics SL support for further assistance!

    --////////////////////////////////////////////////////////////////
    --
    -- Script Instructions:
    --
    -- 1. Update the line in the following code, starting with 'CREATE MASTER KEY ENCRYPTION BY PASSWORD', to contain the
    -- Master key you wish to use. The master key must meet the Windows password policy
    -- requirements of the computer that is running the instance of SQL Server.
    --
    -- 2. Run this script against the Management Reporter 2012 database. This script
    -- will output a message if it does not detect the Management Reporter 2012 database.
    --
    --////////////////////////////////////////////////////////////////

    IF EXISTS (SELECT Name FROM sys.tables WHERE Name = 'ControlReportSchedule')
    BEGIN
    IF EXISTS (SELECT TOP(1) name FROM sys.symmetric_keys WHERE name = 'GeneralUserSymmetricKey')
    DROP SYMMETRIC KEY GeneralUserSymmetricKey

    IF EXISTS (SELECT TOP(1) name FROM sys.certificates WHERE name = 'GeneralUserCertificate')
    DROP CERTIFICATE GeneralUserCertificate

    IF EXISTS (SELECT TOP(1) name FROM sys.symmetric_keys WHERE name = 'ConnectorServiceSymmetricKey')
    DROP SYMMETRIC KEY ConnectorServiceSymmetricKey

    IF EXISTS (SELECT TOP(1) name FROM sys.certificates WHERE name = 'ConnectorServiceCertificate')
    DROP CERTIFICATE ConnectorServiceCertificate

    IF EXISTS (SELECT TOP(1) name FROM sys.symmetric_keys WHERE name = '##MS_DatabaseMasterKey##')
    DROP MASTER KEY

    CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Access!23'
    -- NOTE Where Access!23 is your actual password

    CREATE CERTIFICATE [ConnectorServiceCertificate]
    AUTHORIZATION [dbo]
    WITH SUBJECT = N'Certificate for symmetric key encryption - for use by the connector service.'

    CREATE CERTIFICATE [GeneralUserCertificate]
    AUTHORIZATION [dbo]
    WITH SUBJECT = N'Certificate for access symmetric keys - for use by users assigned to the GeneralUser Role.'

    CREATE SYMMETRIC KEY [ConnectorServiceSymmetricKey]
    AUTHORIZATION [dbo]
    WITH ALGORITHM = AES_256
    ENCRYPTION BY CERTIFICATE [ConnectorServiceCertificate]

    CREATE SYMMETRIC KEY [GeneralUserSymmetricKey]
    AUTHORIZATION [dbo]
    WITH ALGORITHM = AES_256
    ENCRYPTION BY CERTIFICATE [GeneralUserCertificate]

    IF NOT EXISTS (SELECT TOP(1) name FROM sys.database_principals WHERE name='GeneralUser')
    BEGIN
    CREATE ROLE [GeneralUser]
    AUTHORIZATION [dbo]
    END

    GRANT CONTROL ON CERTIFICATE::[GeneralUserCertificate] TO [GeneralUser]
    GRANT VIEW DEFINITION on SYMMETRIC KEY::[GeneralUserSymmetricKey] TO [GeneralUser]
    GRANT CONTROL ON CERTIFICATE::[ConnectorServiceCertificate] TO [GeneralUser]
    GRANT VIEW DEFINITION on SYMMETRIC KEY::[ConnectorServiceSymmetricKey] TO [GeneralUser]
    UPDATE Connector.Adapter
    SET Settings.modify('declare namespace x="">www.microsoft.com/.../Integration";
    replace value of
    (/SettingsCollection/x:ArrayOfSettingsValue/x:SettingsValue[x:Attributes="Password"]/x:Value/text())[1]
    with ""')
    UPDATE Connector.MapCategoryAdapterSettings
    SET Settings.modify('declare namespace x="">www.microsoft.com/.../Integration";
    replace value of
    (/SettingsCollection/x:ArrayOfSettingsValue/x:SettingsValue[x:Attributes="Password"]/x:Value/text())[1]
    with ""')
    END
    ELSE
    BEGIN
    PRINT 'WARNING: Incorrect database selected.'
    Print 'Execute script against the Management Reporter 2012 database.'
    PRINT 'This can be found in the Management Reporter 2012 Configuration Console.'
    END

  • CFROTON Profile Picture
    4,710 on at
    RE: Error in MR: Please create a master key in the database or open the master key in the session before performing this operation

    Dear Kenzie,

    What are you doing in MR when you get the message?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,209 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans