$EventLog = Get-WinEvent -ListLog Microsoft-Windows-PrintService/Operational $EventLog | %{$_.IsEnabled = $true; $_.MaximumSizeInBytes=50MB; $_.LogMode = "AutoBackup" $_.SaveChanges()}
One thing you will notice is that I call SaveChanges() after I see all the values. None of the settings will be saved if you don't do that. It is one of those details that could easily be missed if you were not looking for it.
I polished it up a bit as a CmdLet: Enable-PrintHistory
No comments:
Post a Comment