Created
August 24, 2018 01:52
-
-
Save jfrantz1-r7/55046cd7bf421c4029afba3cc9ff6b17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enable-ProtectedEventLogging | |
{ | |
param( | |
[Parameter(Mandatory)] | |
$Certificate | |
) | |
$basePath = “HKLM:\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging” | |
if(-not (Test-Path $basePath)) | |
{ | |
$null = New-Item $basePath –Force | |
} | |
Set-ItemProperty $basePath -Name EnableProtectedEventLogging -Value “1” | |
Set-ItemProperty $basePath -Name EncryptionCertificate -Value $Certificate | |
} | |
function Disable-ProtectedEventLogging | |
{ | |
Remove-Item HKLM:\Software\Policies\Microsoft\Windows\EventLog\ProtectedEventLogging -Force –Recurse | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment