Categories
Sitecore

Quick Self-Signed Certs Sitecore 9.x

When you download and install Sitecore XP1, you need to install all of the certificates first. If you need to do this often like I do, this can be quite tedious.  Stealing some code from the Single-Developer.ps1, this simple foreach wrapper is a huge time saver.

This assumes you already have the Sitecore Installation Framework installed(SIF) and can execute PowerShell scripts. Please use real certificates in production.

Enjoy!

###############################
# CreateAllSelfSignedCerts

# Prefix for sites
$Prefix = "sitecore"
# Folder with the install files in it (specifically the createcert.json)
$SCInstallRoot = "C:\Sitecore\9.1.1\XP1\"

$ContentDeliverySiteName = "$prefix.cd"
$ContentManagementSiteName = "$prefix.cm"
$ReportingSiteName = "$prefix.rep"
$ProcessingSiteName = "$prefix.prc"
$ReferenceDateSiteName = "$prefix.refdata"
$IdentityServerSiteName = "$prefix.identityserver"
$XP1MarketingAutomationSiteName = "$prefix.ma"
$XP1MarketingAutomationReportingSiteName = "$prefix.mareporting"
$XP1ClientCertificateName = "$prefix.xconnect_client"
$XP1CollectionSitename = "$prefix.collection"
$XP1CollectionSearchSitename = "$prefix.search"
$XP1CortexProcessingSitename = "$prefix.processingEngine"
$XP1CortexReportingSitename = "$prefix.reporting"

$siteNames =
$ContentDeliverySiteName,
$ContentManagementSiteName,
$ReportingSiteName,
$ProcessingSiteName,
$ReferenceDateSiteName,
$IdentityServerSiteName,
$XP1MarketingAutomationSiteName,
$XP1MarketingAutomationReportingSiteName,
$XP1ClientCertificateName,
$XP1CollectionSitename,
$XP1CollectionSearchSitename,
$XP1CortexProcessingSitename,
$XP1CortexReportingSitename

function InstallCertificates {
Foreach ($site in $siteNames) {
$certParams = @{
Path = "$SCInstallRoot\createcert.json"
CertificateName = $site
}
Install-SitecoreConfiguration @certParams -Verbose *&>1 | Tee-Object ".\CertInstall.${site}.log"
}
}
InstallCertificates

By Greg Coffman

Technical strategist, agile evangelist, and all-around web nerd. Spends the day as Solution Architect at Sitecore. Thoughts and ideas are my own and do not represent Sitecore.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.