![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest
Posts: n/a
| Using PowerShell to handle Eventlog Hello, my idea is as follows (basically to play & learn with Powershell): * Running a daily powershellscript at night which: ** Exports all entries in a file ** Delete all entries Ok i could use somethnig like this to list all System-Event Entries and write them to log:
Now i am asking myself howto delete all entries in the second step. any ideas how to handle this ? Best regards fidel | ||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
| |
| | #2 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest
Posts: n/a
| Re: Using PowerShell to handle Eventlog Ok, i can use this:
and i can use this:
Now regarding the filename: -- i.e. i would like to end with files like that: * 20080415_hostname_logtype.txt (execution_date + hostname + here: system Best regards fidel | ||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest
Posts: n/a
| Re: Using PowerShell to handle Eventlog
this. You can export your entire log, parse the export, delete the entries you want, then re-import it. But... This method can only be re-imported, to my knowledge, to a *new* log name, and can't be re-imported into the default/original log. For example, I can't export the Security log, delete it, then re-import what I just exported back to the Security log. I wouldn't start editing the binary log either... Marco | ||||||||||||
| |||||||||||||
| |
| |