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 | | | | |____/ |______ | | | | | |_____|
0 commit comments