TrimarcJake / Locksmith

A small tool built to find and fix common misconfigurations in Active Directory Certificate Services.
https://github.com/TrimarcJake/Locksmith
Other
901 stars 89 forks source link

PowerShell 7 nTSecurityDescriptor missing properties #143

Closed mrhousz closed 4 months ago

mrhousz commented 4 months ago

Environment: Locksmith 2024.3, installed from PSGallery using Install-Module Locksmith Windows 10 Enterprise 22H2, July 2024 security updates PowerShell 7.4.4

Issue:

Running Invoke-Locksmith in PowerShell 7 returns errors:

A constructor was not found. Cannot find an appropriate constructor for type System.Security.Principal.NTAccount.

This is due to missing object properties in the nTSecurityDescriptor object collected by Get-ADCSObject function.

image

Potential fix/workaround:

https://github.com/PowerShell/PowerShell/issues/21540#issuecomment-2080330448

Import-Module Microsoft.PowerShell.Security prior to running Invoke-Locksmith results in the objects collected by Get-ADCSObject having the needed nTSecurityDescriptor properties

image

SamErde commented 4 months ago

Good find. We should be able to test that and add to the module manifest so you don't need to manually import it.

TrimarcJake commented 4 months ago

Agreed. Should be way fix. @SamErde you wanna handle or me?

SamErde commented 4 months ago

On it!

On Fri, Jul 26, 2024 at 6:50 AM Jake Hildreth @.***> wrote:

Agreed. Should be way fix. @SamErde https://github.com/SamErde you wanna handle or me?

— Reply to this email directly, view it on GitHub https://github.com/TrimarcJake/Locksmith/issues/143#issuecomment-2252500308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE4HWGISBGQQNYJALUQAI43ZOISXFAVCNFSM6AAAAABLPPQBUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJSGUYDAMZQHA . You are receiving this because you were mentioned.Message ID: @.***>

TrimarcJake commented 4 months ago

Thank you, friend.

mrhousz commented 4 months ago

Thank you for this module and glad I could help. This was my first Github issue.