I have created a certificate on SQL server for encrypting my database backups. I used the following article for instructions.
I need to restore this database to multiple servers. I can use the following code to import/create the certificate on another server.
-- Copy Certificate to target then create
CREATE CERTIFICATE myCertificate
FROM FILE = 'C:\Temp\CertBackup.cer'
WITH PRIVATE KEY (FILE = 'C:\Temp\CertBackup.pvk',
DECRYPTION BY PASSWORD = 'myPassword');
GO
I would like to be able to import this certificate to many servers at once instead of running this command on each server. Should I script this with Powershell or is there a better way?