Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Clear-event log error..Kindly Help Me.

$
0
0

Hey All, kindly help me. I am using  below powershell script to delete event log from all my client machines.

$computer = get-content c:\system.txt

clear-eventlog "system","Application","Security" -comp $computer

I noticed that in most of the XP machines.it works good but for windows 7 it does't and give me an error message--

Clear-EventLog : The path to the "abcd4565" computer cannot be found.

At line:1 char:15
+ Clear-EventLog <<<<  "Application" -comp ravindra4565
    + CategoryInfo          : InvalidOperation: (:) [Clear-EventLog], IOException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.ClearEventLogComman

But ideally system(example abcd4565 exists in our environment and i am able to ping the system as well.

Kindly help me in solving this issue and other help is how can i silently run this with out displaying error message (as above) and generates a log file ,so it is more presentable to management.


Senior System Engineer.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>