From 04b667042a4251d3de5dd6045952eb21d9913f2b Mon Sep 17 00:00:00 2001 From: brokenvhs <38253915+brokenvhs@users.noreply.github.com> Date: Sun, 19 Jan 2025 22:19:19 +0000 Subject: [PATCH] Move instantiation of the CAEnrollmentEndpoint array into the for loop iterating on the pKIEnrollmentService objects. --- Private/Set-AdditionalCAProperty.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Private/Set-AdditionalCAProperty.ps1 b/Private/Set-AdditionalCAProperty.ps1 index f53b571d..a4fe817f 100644 --- a/Private/Set-AdditionalCAProperty.ps1 +++ b/Private/Set-AdditionalCAProperty.ps1 @@ -36,7 +36,6 @@ ) begin { - $CAEnrollmentEndpoint = @() if (-not ([System.Management.Automation.PSTypeName]'TrustAllCertsPolicy') ) { if ($PSVersionTable.PSEdition -eq 'Desktop') { $code = @" @@ -69,6 +68,7 @@ process { $ADCSObjects | Where-Object objectClass -Match 'pKIEnrollmentService' | ForEach-Object { + $CAEnrollmentEndpoint = @() #[array]$CAEnrollmentEndpoint = $_.'msPKI-Enrollment-Servers' | Select-String 'http.*' | ForEach-Object { $_.Matches[0].Value } foreach ($directory in @("certsrv/", "$($_.Name)_CES_Kerberos/service.svc", "$($_.Name)_CES_Kerberos/service.svc/CES", "ADPolicyProvider_CEP_Kerberos/service.svc", "certsrv/mscep/")) { $URL = "://$($_.dNSHostName)/$directory"