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.