[Script of May 28] How to check if master key for master database is not encrypted


Script Download:  
The script is available for download in Microsoft Script Browser for Windows PowerShell ISE. You need to install the Script Browser application first, and search for the script sample title.

This script can be used to detect if the database master key is not encrypted by Service Master Key.

SQL Server uses a hierarchy of keys and certificates when a database is enabled for Transparent Database Encryption [TDE]. At the upper levels of the hierarchy, the Service Master Key [SMK] encrypts the Database Master Key [DMK] for the master database. The Database Master Key [DMK] encrypts and protects the Certificate and Database Encryption Key [DEK] involved in the encryption of the user database. After enabling a user database for TDE, you will be able to remove the SMK encryption of the DMK for the master database. If you restart the SQL Server at this point, the database startup will encounter error 15581 and prevent the database from starting up. In some situations, the LogWriter will hang with a wait_type of WRITE_LOG and prevent any transactions from committing in this database. Even though it is possible to remove the SMK encryption for the master database DMK, it is not recommended to do this. 

image image
 image

You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery

Comments (5)

  1. Anonymous says:

    Pingback from Weekly IT Newsletter – May 26-30, 2014 | Just a Lync Guy

  2. Anonymous says:

    Pingback from Weekly IT Newsletter – May 26-30, 2014 | Just a Lync Guy

  3. Anonymous says:

    Pingback from NeWay Technologies – Weekly Newsletter #97 – May 29, 2014 | NeWay

  4. Anonymous says:

    Pingback from NeWay Technologies – Weekly Newsletter #97 – May 30, 2014 | NeWay

  5. aw says:

    hai, I just want to tell you that I am just very new to blogs and seriously loved this website. More than likely I’m planning to bookmark your blog post .
    You amazingly come with really good posts. Thanks a lot for sharing your blog Microsoft.
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT.%20Brantas%20Abipraya
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Jasa%20Marga
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Bukit%20Asam
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Sarana%20Multigriya%20Finansial
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Wijaya%20Karya%20Beton
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT.%20Kereta%20Api%20Indonesia
    http://www.lokerjobindo.com/search/label/Loker%20Daerah%20Solo
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Danareksa
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Perusahaan%20umum%20Jaminan%20Kredit%20Indonesia%20Jamkrindo
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Reasuransi%20Internasional%20Indonesia
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20Lion%20Super%20Indo
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT.%20Djarum%20Indonesia%20Tbk
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20BPJS%20Ketenagakerjaan
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Staf%20LKPP
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20BUMN
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Terbaru
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20Bank
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20SMA
    http://www.lokerjobindo.com
    http://www.yacinta.com
    http://www.kerjabumn.com
    http://www.wisatasia.id/search/label/Wisata-Indonesia

    http://www.wisatasia.id
    http://www.lokerjobindo.com/search/label/Lowongan%20Kerja%20PT%20PAL%20Indonesia%20Persero