MSEndpointMgr / Intune

Microsoft Intune scripts
MIT License
657 stars 245 forks source link

Certificates/Install-MSIntuneNDESServer.ps1 #68

Open TimoHuebner0815 opened 1 year ago

TimoHuebner0815 commented 1 year ago

90: $ServerAuthenticationCertificate = Get-ChildItem -Path "Cert:\LocalMachine\My" -ErrorAction Stop | Where-Object { ($.Subject -match $NDESExternalFQDN) -and ($.Extensions["2.5.29.37"].EnhancedKeyUsages.FriendlyName.Contains("Server Authentication")) }

because the certificate can carry multiple FQDN it should be changed to:

$ServerAuthenticationCertificate = Get-ChildItem -Path "Cert:\LocalMachine\My" -ErrorAction Stop | Where-Object { ($.DnsNameList -match $NDESExternalFQDN) -and ($.Extensions["2.5.29.37"].EnhancedKeyUsages.FriendlyName.Contains("Server Authentication")) }

same for $ClientAuthenticationCertificate in line104