Skip to content

Commit fdfc0dc

Browse files
authored
Merge pull request #245 from jakehildreth/testing
2025.04.20 Release
2 parents 717e79f + 12333be commit fdfc0dc

6 files changed

Lines changed: 36 additions & 19 deletions

File tree

Build/Build-Module.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Build-Module -ModuleName 'Locksmith' {
3232
ProjectUri = 'https://github.com/jakehildreth/Locksmith'
3333
IconUri = 'https://raw.githubusercontent.com/jakehildreth/Locksmith/main/Images/locksmith.ico'
3434
PowerShellVersion = '5.1'
35-
Tags = @('Windows', 'Locksmith', 'CA', 'PKI', 'ActiveDirectory', 'CertificateServices', 'ADCS')
35+
Tags = @('Locksmith', 'ActiveDirectory', 'ADCS', 'CA', 'Certificate', 'CertificateAuthority', 'CertificateServices', 'PKI', 'X509', 'Windows')
3636
}
3737
New-ConfigurationManifest @Manifest
3838

@@ -120,10 +120,16 @@ Build-Module -ModuleName 'Locksmith' {
120120
New-ConfigurationBuild -Enable:$true -SignModule:$false -DeleteTargetModuleBeforeBuild -MergeModuleOnBuild #-UseWildcardForFunctions
121121

122122
$PreScriptMerge = {
123+
[CmdletBinding(HelpUri = 'https://jakehildreth.github.io/Locksmith/Invoke-Locksmith')]
123124
param (
124-
[int]$Mode,
125+
# The mode to run Locksmith in. Defaults to 0.
126+
[Parameter(Mandatory = $false)]
127+
[ValidateSet(0, 1, 2, 3, 4)]
128+
[int]$Mode = 0,
129+
130+
# The scans to run. Defaults to 'All'.
125131
[Parameter()]
126-
[ValidateSet('Auditing','ESC1','ESC2','ESC3','ESC4','ESC5','ESC6','ESC8','ESC11','ESC13','ESC15','EKUwu','All','PromptMe')]
132+
[ValidateSet('Auditing', 'ESC1', 'ESC2', 'ESC3', 'ESC4', 'ESC5', 'ESC6', 'ESC8', 'ESC11', 'ESC13', 'ESC15', 'EKUwu', 'All', 'PromptMe')]
127133
[array]$Scans = 'All'
128134
)
129135
}

Docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://github.com/readthedocs-examples/example-mkdocs-basic/blob/main/docs/requirements.txt
22
# requirements.txt
3-
jinja2==3.1.4 #https://pypi.org/project/Jinja2/
3+
jinja2==3.1.5 #https://pypi.org/project/Jinja2/
44
mkdocs>=1.6.0 #https://github.com/mkdocs/mkdocs
55
mkdocs-material==9.5.25 #https://github.com/squidfunk/mkdocs-material
66
pygments>=2.18.0 #https://pypi.org/project/Pygments/

Invoke-Locksmith.ps1

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
param (
2-
[int]$Mode,
1+
[CmdletBinding(HelpUri = 'https://jakehildreth.github.io/Locksmith/Invoke-Locksmith')]
2+
param (
3+
# The mode to run Locksmith in. Defaults to 0.
4+
[Parameter(Mandatory = $false)]
5+
[ValidateSet(0, 1, 2, 3, 4)]
6+
[int]$Mode = 0,
7+
8+
# The scans to run. Defaults to 'All'.
39
[Parameter()]
410
[ValidateSet('Auditing', 'ESC1', 'ESC2', 'ESC3', 'ESC4', 'ESC5', 'ESC6', 'ESC8', 'ESC11', 'ESC13', 'ESC15', 'EKUwu', 'All', 'PromptMe')]
511
[array]$Scans = 'All'
@@ -581,7 +587,7 @@ More info:
581587
Step 1: Open an elevated Powershell session as an AD or PKI Admin
582588
Step 2: Run Unpublish-SchemaV1Templates.ps1
583589
#>
584-
Invoke-WebRequest -Uri https://bit.ly/Fix-ESC15 | Invoke-Expression
590+
Invoke-WebRequest -Uri https://gist.githubusercontent.com/jakehildreth/13c7d615adc905d317fc4379026ad28e/raw/Unpublish-SchemaV1Templates.ps1 | Invoke-Expression
585591
586592
"@
587593
Revert = '[TODO]'
@@ -2900,11 +2906,16 @@ function Set-AdditionalCAProperty {
29002906
$CAHostDistinguishedName = (Get-ADObject -Filter { (Name -eq $CAHostName) -and (objectclass -eq 'computer') } -Server $ForestGC ).DistinguishedName
29012907
$CAHostFQDN = (Get-ADObject -Filter { (Name -eq $CAHostName) -and (objectclass -eq 'computer') } -Properties DnsHostname -Server $ForestGC).DnsHostname
29022908
}
2903-
$ping = Test-Connection -ComputerName $CAHostFQDN -Quiet -Count 1
2909+
$ping = if ($CAHostFQDN) {
2910+
Test-Connection -ComputerName $CAHostFQDN -Count 1 -Quiet
2911+
}
2912+
else {
2913+
Write-Warning "Unable to resolve $($_.Name) Fully Qualified Domain Name (FQDN)"
2914+
}
29042915
if ($ping) {
29052916
try {
29062917
if ($Credential) {
2907-
$CertutilAudit = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg CA\AuditFilter } -ArgumentList $CAFullName
2918+
$CertutilAudit = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg CA\AuditFilter }
29082919
}
29092920
else {
29102921
$CertutilAudit = certutil -config $CAFullName -getreg CA\AuditFilter
@@ -2915,7 +2926,7 @@ function Set-AdditionalCAProperty {
29152926
}
29162927
try {
29172928
if ($Credential) {
2918-
$CertutilFlag = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg policy\EditFlags } -ArgumentList $CAFullName
2929+
$CertutilFlag = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg policy\EditFlags }
29192930
}
29202931
else {
29212932
$CertutilFlag = certutil -config $CAFullName -getreg policy\EditFlags
@@ -2926,7 +2937,7 @@ function Set-AdditionalCAProperty {
29262937
}
29272938
try {
29282939
if ($Credential) {
2929-
$CertutilInterfaceFlag = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg CA\InterfaceFlags } -ArgumentList $CAFullName
2940+
$CertutilInterfaceFlag = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg CA\InterfaceFlags }
29302941
}
29312942
else {
29322943
$CertutilInterfaceFlag = certutil -config $CAFullName -getreg CA\InterfaceFlags
@@ -4390,7 +4401,7 @@ function Invoke-Locksmith {
43904401
[System.Management.Automation.PSCredential]$Credential
43914402
)
43924403

4393-
$Version = '2025.2.22'
4404+
$Version = '2025.4.20'
43944405
$LogoPart1 = @'
43954406
_ _____ _______ _ _ _______ _______ _____ _______ _ _
43964407
| | | | |____/ |______ | | | | | |_____|

Locksmith.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
FunctionsToExport = 'Invoke-Locksmith'
99
GUID = 'b1325b42-8dc4-4f17-aa1f-dcb5984ca14a'
1010
HelpInfoURI = 'https://raw.githubusercontent.com/jakehildreth/Locksmith/main/en-US/'
11-
ModuleVersion = '2025.2.22'
11+
ModuleVersion = '2025.4.20'
1212
PowerShellVersion = '5.1'
1313
PrivateData = @{
1414
PSData = @{
1515
ExternalModuleDependencies = @('ActiveDirectory', 'ServerManager', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.LocalAccounts', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security', 'CimCmdlets', 'Dism')
1616
IconUri = 'https://raw.githubusercontent.com/jakehildreth/Locksmith/main/Images/locksmith.ico'
1717
ProjectUri = 'https://github.com/jakehildreth/Locksmith'
18-
Tags = @('Windows', 'Locksmith', 'CA', 'PKI', 'ActiveDirectory', 'CertificateServices', 'ADCS')
18+
Tags = @('Locksmith', 'ActiveDirectory', 'ADCS', 'CA', 'Certificate', 'CertificateAuthority', 'CertificateServices', 'PKI', 'X509', 'Windows')
1919
}
2020
}
2121
RequiredModules = @('ActiveDirectory', 'ServerManager', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.LocalAccounts', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security', 'CimCmdlets', 'Dism')

Private/Find-ESC15.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ More info:
8282
Step 1: Open an elevated Powershell session as an AD or PKI Admin
8383
Step 2: Run Unpublish-SchemaV1Templates.ps1
8484
#>
85-
Invoke-WebRequest -Uri https://bit.ly/Fix-ESC15 | Invoke-Expression
85+
Invoke-WebRequest -Uri https://gist.githubusercontent.com/jakehildreth/13c7d615adc905d317fc4379026ad28e/raw/Unpublish-SchemaV1Templates.ps1 | Invoke-Expression
8686
8787
"@
8888
Revert = '[TODO]'

Private/Set-AdditionalCAProperty.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@
127127
$CAHostDistinguishedName = (Get-ADObject -Filter { (Name -eq $CAHostName) -and (objectclass -eq 'computer') } -Server $ForestGC ).DistinguishedName
128128
$CAHostFQDN = (Get-ADObject -Filter { (Name -eq $CAHostName) -and (objectclass -eq 'computer') } -Properties DnsHostname -Server $ForestGC).DnsHostname
129129
}
130-
$ping = Test-Connection -ComputerName $CAHostFQDN -Quiet -Count 1
130+
$ping = if ($CAHostFQDN) { Test-Connection -ComputerName $CAHostFQDN -Count 1 -Quiet } else { Write-Warning "Unable to resolve $($_.Name) Fully Qualified Domain Name (FQDN)" }
131131
if ($ping) {
132132
try {
133133
if ($Credential) {
134-
$CertutilAudit = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg CA\AuditFilter } -ArgumentList $CAFullName
134+
$CertutilAudit = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg CA\AuditFilter }
135135
} else {
136136
$CertutilAudit = certutil -config $CAFullName -getreg CA\AuditFilter
137137
}
@@ -140,7 +140,7 @@
140140
}
141141
try {
142142
if ($Credential) {
143-
$CertutilFlag = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg policy\EditFlags } -ArgumentList $CAFullName
143+
$CertutilFlag = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg policy\EditFlags }
144144
} else {
145145
$CertutilFlag = certutil -config $CAFullName -getreg policy\EditFlags
146146
}
@@ -149,7 +149,7 @@
149149
}
150150
try {
151151
if ($Credential) {
152-
$CertutilInterfaceFlag = Invoke-Command -ComputerName $CAHostname -Credential $Credential -ScriptBlock { param($CAFullName); certutil -config $CAFullName -getreg CA\InterfaceFlags } -ArgumentList $CAFullName
152+
$CertutilInterfaceFlag = Invoke-Command -ComputerName $CAHostFQDN -Credential $Credential -ScriptBlock { certutil -config $using:CAFullName -getreg CA\InterfaceFlags }
153153
} else {
154154
$CertutilInterfaceFlag = certutil -config $CAFullName -getreg CA\InterfaceFlags
155155
}

0 commit comments

Comments
 (0)