Forum Discussion
Cole_McDonald
Professor
2 months agoAnything that access the Security event logs from a remote machine will fail... there is a registry permission that needs to be granted for the user:
$domainName = (get-wmiobject win32_computersystem).domain
$userName = "LM_ServiceAccount_Name"
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Security"
$rule = New-Object System.Security.AccessControl.RegistryAccessRule ("$DomainName\$UserName","ReadKey","Allow")
$acl = Get-Acl $regPath
$acl.SetAccessRule($rule)
$acl | Set-Acl -Path $regPath
Related Content
- 9 months ago
- 12 months ago