Install-sqmCertificateToStore
TLS sqmSQLTool v1.8.2+
Imports a certificate into a specified Windows certificate store.

Examples

# Install a CA root certificate to the Trusted Root store on all AlwaysOn replica nodes
# Install a CA root certificate to the Trusted Root store on all AlwaysOn replica nodes
    $nodes = 'SQL-AG-01', 'SQL-AG-02', 'SQL-AG-03'
    Install-sqmCertificateToStore -CertFile 'C:\Certs\CompanyRootCA.cer' `
        -StoreName Root -ComputerName $nodes
# Distribute a SQL Server self-signed certificate to an admin workstation
# Distribute a SQL Server self-signed certificate to an admin workstation
    Install-sqmCertificateToStore -CertFile 'C:\Certs\SQL-PROD-01.cer' `
        -StoreName TrustedPeople -ComputerName 'ADMINWS-01'
# Distribute an AlwaysOn partner certificate (CER without private key) to replica machines
# Distribute an AlwaysOn partner certificate (CER without private key) to replica machines
    $replicas = 'SQL-AG-02', 'SQL-AG-03'
    Install-sqmCertificateToStore -CertFile 'C:\Certs\SQL-AG-01_AG_CERT.cer' `
        -StoreName My -ComputerName $replicas
# Install a PFX certificate with password into the Personal store on the local machine
# Install a PFX certificate with password into the Personal store on the local machine
    $pwd = Read-Host -AsSecureString 'PFX password'
    Install-sqmCertificateToStore -CertFile 'C:\Certs\sql-ssl.pfx' `
        -StoreName My -CertPassword $pwd