Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Start-C4bCcmSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ process {
}
choco config set centralManagementServiceUrl "$($CcmEndpoint):24020/ChocolateyManagementService"

#Generate CCM Salt Values
if (-not (Get-ChocoEnvironmentProperty ClientSalt)) {
$ClientSaltValue = New-ServicePassword
Set-ChocoEnvironmentProperty ClientSalt $ClientSaltValue
}

if (-not (Get-ChocoEnvironmentProperty ServiceSalt)) {
$ServiceSaltValue = New-ServicePassword
Set-ChocoEnvironmentProperty ServiceSalt $ServiceSaltValue
}

# Updating the Registration Script
$EndpointScript = "$PSScriptRoot\scripts\Register-C4bEndpoint.ps1"
Invoke-TextReplacementInFile -Path $EndpointScript -Replacement @{
Expand Down Expand Up @@ -234,20 +245,9 @@ process {
Set-ChocoEnvironmentProperty CCMEncryptionPassword $CCMEncryptionPassword
}

# Set Client and Service salts
if (-not (Get-ChocoEnvironmentProperty ClientSalt)) {
$ClientSaltValue = New-ServicePassword
Set-ChocoEnvironmentProperty ClientSalt $ClientSaltValue

Invoke-Choco config set centralManagementClientCommunicationSaltAdditivePassword $ClientSaltValue.ToPlainText()
}

if (-not (Get-ChocoEnvironmentProperty ServiceSalt)) {
$ServiceSaltValue = New-ServicePassword
Set-ChocoEnvironmentProperty ServiceSalt $ServiceSaltValue

Invoke-Choco config set centralManagementServiceCommunicationSaltAdditivePassword $ServiceSaltValue.ToPlainText()
}
# Set Client and Service salts in Chocolatey Config
Invoke-Choco config set centralManagementClientCommunicationSaltAdditivePassword $ClientSaltValue.ToPlainText()
Invoke-Choco config set centralManagementServiceCommunicationSaltAdditivePassword $ServiceSaltValue.ToPlainText()

# Set Website Root Address
Update-CcmSettings -CcmEndpoint $CCmEndpoint -Credential $CCMCredential -Settings @{
Expand Down
Loading