Skip to content

Commit d852ba1

Browse files
authored
Merge 0652296 into 9fcf193
2 parents 9fcf193 + 0652296 commit d852ba1

File tree

5 files changed

+15
-150
lines changed

5 files changed

+15
-150
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
2.5.2
2+
* Fixed a PowerShell compatibility issue when using LocalMachine. LocalMachine will always run PowerShell 5.1.
3+
14
2.5.1
25
* Fixed WinSQL service name when InstanceID differs from InstanceName
36

47
2.5.0
58
* Added the Bindings to the end of the thumbprint to make the alias unique.
69
* Using new IISWebBindings commandlet to use additional SSL flags when binding certificate to website.
710
* Added multi-platform support for .Net6 and .Net8.
8-
* Updated various PowerShell scripts to handle both .Net6 and .Net8 differences (specifically the absense of the WebAdministration module in PS SDK 7.4.x+)
11+
* Updated various PowerShell scripts to handle both .Net6 and .Net8 differences (specifically the absence of the WebAdministration module in PS SDK 7.4.x+)
912
* Fixed issue to update multiple websites when using the same cert.
1013
* Removed renewal thumbprint logic to update multiple website; each job now updates its own specific certificate.
1114

IISU/ClientPSIIManager.cs

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -567,78 +567,7 @@ private object PerformIISUnBinding(string webSiteName, string protocol, string i
567567
/// <returns></returns>
568568
private object PerformIISBinding(string webSiteName, string protocol, string ipAddress, string port, string hostName, string sslFlags, string thumbprint, string storeName)
569569
{
570-
//string funcScript = @"
571-
// param (
572-
// $SiteName, # The name of the IIS site
573-
// $IPAddress, # The IP Address for the binding
574-
// $Port, # The port number for the binding
575-
// $Hostname, # Hostname for the binding (if any)
576-
// $Protocol, # Protocol (e.g., HTTP, HTTPS)
577-
// $Thumbprint, # Certificate thumbprint for HTTPS bindings
578-
// $StoreName, # Certificate store location (e.g., ""My"" for personal certs)
579-
// $SslFlags # SSL flags (if any)
580-
// )
581-
582-
// # Set Execution Policy (optional, depending on your environment)
583-
// Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
584-
585-
// ## Check if the IISAdministration module is available
586-
// #$module = Get-Module -Name IISAdministration -ListAvailable
587-
588-
// #if (-not $module) {
589-
// # throw ""The IISAdministration module is not installed on this system.""
590-
// #}
591-
592-
// # Check if the IISAdministration module is already loaded
593-
// if (-not (Get-Module -Name IISAdministration)) {
594-
// try {
595-
// # Attempt to import the IISAdministration module
596-
// Import-Module IISAdministration -ErrorAction Stop
597-
// }
598-
// catch {
599-
// throw ""Failed to load the IISAdministration module. Ensure it is installed and available.""
600-
// }
601-
// }
602-
603-
// # Retrieve the existing binding information
604-
// $myBinding = ""${IPAddress}:${Port}:${Hostname}""
605-
// Write-Host ""myBinding: "" $myBinding
606-
607-
// $siteBindings = Get-IISSiteBinding -Name $SiteName
608-
// $existingBinding = $siteBindings | Where-Object { $_.bindingInformation -eq $myBinding -and $_.protocol -eq $Protocol }
609-
610-
// Write-Host ""Binding:"" $existingBinding
611-
612-
// if ($null -ne $existingBinding) {
613-
// # Remove the existing binding
614-
// Remove-IISSiteBinding -Name $SiteName -BindingInformation $existingBinding.BindingInformation -Protocol $existingBinding.Protocol -Confirm:$false
615-
616-
// Write-Host ""Removed existing binding: $($existingBinding.BindingInformation)""
617-
// }
618-
619-
// # Create the new binding with modified properties
620-
// $newBindingInfo = ""${IPAddress}:${Port}:${Hostname}""
621-
622-
// try
623-
// {
624-
// New-IISSiteBinding -Name $SiteName `
625-
// -BindingInformation $newBindingInfo `
626-
// -Protocol $Protocol `
627-
// -CertificateThumbprint $Thumbprint `
628-
// -CertStoreLocation $StoreName `
629-
// -SslFlag $SslFlags
630-
631-
// Write-Host ""New binding added: $newBindingInfo""
632-
// }
633-
// catch {
634-
// throw $_
635-
// }
636-
//";
637-
#if NET6_0
638-
string funcScript = PowerShellScripts.UpdateIISBindingsV6;
639-
#elif NET8_0_OR_GREATER
640-
string funcScript = PowerShellScripts.UpdateIISBindingsV8;
641-
#endif
570+
string funcScript = PowerShellScripts.UpdateIISBindings;
642571

643572
ps.AddScript(funcScript);
644573
ps.AddParameter("SiteName", webSiteName);

IISU/PSHelper.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,10 @@ public static Runspace GetClientPsRunspace(string winRmProtocol, string clientMa
5050

5151
if (isLocal)
5252
{
53-
#if NET6_0
53+
_logger.LogTrace("Establishing a local RunSpace.");
5454
PowerShellProcessInstance instance = new PowerShellProcessInstance(new Version(5, 1), null, null, false);
5555
Runspace rs = RunspaceFactory.CreateOutOfProcessRunspace(new TypeTable(Array.Empty<string>()), instance);
5656
return rs;
57-
#elif NET8_0_OR_GREATER
58-
try
59-
{
60-
InitialSessionState iss = InitialSessionState.CreateDefault();
61-
Runspace rs = RunspaceFactory.CreateRunspace(iss);
62-
return rs;
63-
}
64-
catch (global::System.Exception)
65-
{
66-
throw new Exception($"An error occurred while attempting to create the PowerShell instance. This version requires .Net8 and PowerShell SDK 7.2 or greater. Please verify the version of .Net8 and PowerShell installed on your machine.");
67-
}
68-
#endif
6957
}
7058
else
7159
{

IISU/Scripts/PowerShellScripts.cs

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,7 @@ namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore.Scripts
88
{
99
public class PowerShellScripts
1010
{
11-
public const string UpdateIISBindingsV6 = @"
12-
param (
13-
$SiteName, # The name of the IIS site
14-
$IPAddress, # The IP Address for the binding
15-
$Port, # The port number for the binding
16-
$Hostname, # Hostname for the binding (if any)
17-
$Protocol, # Protocol (e.g., HTTP, HTTPS)
18-
$Thumbprint, # Certificate thumbprint for HTTPS bindings
19-
$StoreName, # Certificate store location (e.g., ""My"" for personal certs)
20-
$SslFlags # SSL flags (if any)
21-
)
22-
23-
# Set Execution Policy (optional, depending on your environment)
24-
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
25-
26-
# Check if the WebAdministration module is available
27-
$module = Get-Module -Name WebAdministration -ListAvailable
28-
29-
if (-not $module) {
30-
throw ""The WebAdministration module is not installed on this system.""
31-
}
32-
33-
# Check if the WebAdministration module is already loaded
34-
if (-not (Get-Module -Name WebAdministration)) {
35-
try {
36-
# Attempt to import the WebAdministration module
37-
Import-Module WebAdministration -ErrorAction Stop
38-
}
39-
catch {
40-
throw ""Failed to load the WebAdministration module. Ensure it is installed and available.""
41-
}
42-
}
43-
44-
# Retrieve the existing binding information
45-
$myBinding = ""${IPAddress}:${Port}:${Hostname}""
46-
Write-Host ""myBinding: "" $myBinding
47-
48-
$siteBindings = Get-IISSiteBinding -Name $SiteName
49-
$existingBinding = $siteBindings | Where-Object { $_.bindingInformation -eq $myBinding -and $_.protocol -eq $Protocol }
50-
51-
Write-Host ""Binding:"" $existingBinding
52-
53-
if ($null -ne $existingBinding) {
54-
# Remove the existing binding
55-
Remove-IISSiteBinding -Name $SiteName -BindingInformation $existingBinding.BindingInformation -Protocol $existingBinding.Protocol -Confirm:$false
56-
57-
Write-Host ""Removed existing binding: $($existingBinding.BindingInformation)""
58-
}
59-
60-
# Create the new binding with modified properties
61-
$newBindingInfo = ""${IPAddress}:${Port}:${Hostname}""
62-
63-
New-IISSiteBinding -Name $SiteName `
64-
-BindingInformation $newBindingInfo `
65-
-Protocol $Protocol `
66-
-CertificateThumbprint $Thumbprint `
67-
-CertStoreLocation $StoreName `
68-
-SslFlag $SslFlags
69-
70-
Write-Host ""New binding added: $newBindingInfo""";
71-
72-
public const string UpdateIISBindingsV8 = @"
11+
public const string UpdateIISBindings = @"
7312
param (
7413
$SiteName, # The name of the IIS site
7514
$IPAddress, # The IP Address for the binding

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<b>Related Integrations</b>
2929
</a>
3030
</p>
31-
31+
3232
## Overview
3333

3434
The WinCertStore Orchestrator remotely manages certificates in a Windows Server local machine certificate store. Users are able to determine which store they wish to place certificates in by entering the correct store path. For a complete list of local machine cert stores you can execute the PowerShell command:
@@ -113,7 +113,7 @@ The WinSql Certificate Store Type, referred to by its short name 'WinSql,' is de
113113
This integration is compatible with Keyfactor Universal Orchestrator version 10.1 and later.
114114

115115
## Support
116-
The Windows Certificate Universal Orchestrator extension is supported by Keyfactor for Keyfactor customers. If you have a support issue, please open a support ticket with your Keyfactor representative. If you have a support issue, please open a support ticket via the Keyfactor Support Portal at https://support.keyfactor.com.
116+
The Windows Certificate Universal Orchestrator extension If you have a support issue, please open a support ticket by either contacting your Keyfactor representative or via the Keyfactor Support Portal at https://support.keyfactor.com.
117117

118118
> To report a problem or suggest a new feature, use the **[Issues](../../issues)** tab. If you want to contribute actual bug fixes or proposed enhancements, use the **[Pull requests](../../pulls)** tab.
119119
@@ -198,6 +198,8 @@ The Windows Certificate Universal Orchestrator extension implements 3 Certificat
198198

199199
![WinCert Advanced Tab](docsource/images/WinCert-advanced-store-type-dialog.png)
200200

201+
> For Keyfactor **Command versions 24.4 and later**, a Certificate Format dropdown is available with PFX and PEM options. Ensure that **PFX** is selected, as this determines the format of new and renewed certificates sent to the Orchestrator during a Management job. Currently, all Keyfactor-supported Orchestrator extensions support only PFX.
202+
201203
#### Custom Fields Tab
202204
Custom fields operate at the certificate store level and are used to control how the orchestrator connects to the remote target server containing the certificate store to be managed. The following custom fields should be added to the store type:
203205

@@ -279,6 +281,8 @@ The Windows Certificate Universal Orchestrator extension implements 3 Certificat
279281

280282
![IISU Advanced Tab](docsource/images/IISU-advanced-store-type-dialog.png)
281283

284+
> For Keyfactor **Command versions 24.4 and later**, a Certificate Format dropdown is available with PFX and PEM options. Ensure that **PFX** is selected, as this determines the format of new and renewed certificates sent to the Orchestrator during a Management job. Currently, all Keyfactor-supported Orchestrator extensions support only PFX.
285+
282286
#### Custom Fields Tab
283287
Custom fields operate at the certificate store level and are used to control how the orchestrator connects to the remote target server containing the certificate store to be managed. The following custom fields should be added to the store type:
284288

@@ -366,6 +370,8 @@ The Windows Certificate Universal Orchestrator extension implements 3 Certificat
366370

367371
![WinSql Advanced Tab](docsource/images/WinSql-advanced-store-type-dialog.png)
368372

373+
> For Keyfactor **Command versions 24.4 and later**, a Certificate Format dropdown is available with PFX and PEM options. Ensure that **PFX** is selected, as this determines the format of new and renewed certificates sent to the Orchestrator during a Management job. Currently, all Keyfactor-supported Orchestrator extensions support only PFX.
374+
369375
#### Custom Fields Tab
370376
Custom fields operate at the certificate store level and are used to control how the orchestrator connects to the remote target server containing the certificate store to be managed. The following custom fields should be added to the store type:
371377

0 commit comments

Comments
 (0)