Regenerate Service Master Key
How to force-regenerate the service master key to fix replication decryption errors after a restore.
After restoring databases from another server you can hit replication errors like "An error occurred during decryption. There is no remote user 'distributor_admin' mapped to local user '(null)' from the remote server 'repl_distributor'." The cause is that the service master key on this server cannot decrypt the encrypted metadata coming from the distributor. Forcing a regeneration of the service master key resolves it.
/*
Resolves error:
An error occurred during decryption.
There is no remote user 'distributor_admin' mapped to local user '(null)' from the remote server 'repl_distributor'.
*/
ALTER SERVICE MASTER KEY FORCE REGENERATE