I’m trying to run a powershell action script on our Windows machines to enable the print logs in the windows event viewer but I am having an issue on Windows Server 2008 an 2012 (french) machines only. It works fine 2012R2 and up.
Action summary returns this
Invalid action content: the action type is invalid.
Status
Start Time Not Executed
End Time Not Executed
Exit Code None
Here is my script that I am trying to run in a task. If I run it directly in a powershell shell on the 2008/2012 machine, it works and the windows event log gets enabled.
$printLog = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration “Microsoft-Windows-PrintService/Operational”
$printLog.IsEnabled = $true
$printLog.SaveChanges()
I have tried to run simple “write-host” but I get the same issue.