Parity123
asked on
Powershell: Logs script assistance
Hello,
I am trying to enumerate all the event logs on a server and get 10 newest events from each log. I have something like this. I need some help with this. How do I enumerate the different logs such as System, Application, Directoryservice, FileReplication etc...
I need to replace $Logs with some dynamic code that will enumerate all the event logs on a machine.
$Logs ="System", "Application"
Foreach ($log in $logs) {
#Pull 10 newest events and store it in a file.
}
Thanks for your assistance.
I am trying to enumerate all the event logs on a server and get 10 newest events from each log. I have something like this. I need some help with this. How do I enumerate the different logs such as System, Application, Directoryservice, FileReplication etc...
I need to replace $Logs with some dynamic code that will enumerate all the event logs on a machine.
$Logs ="System", "Application"
Foreach ($log in $logs) {
#Pull 10 newest events and store it in a file.
}
Thanks for your assistance.
ASKER
I am trying to get the time difference between the oldest event and the newest event and convert this into minutes, Could you please give me a hand.
$timedifference-in-minutes = newest event - oldest event
$timedifference-in-minutes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I am dividing current size / totalminutes I get a value output as 2.134523e-05 instead how do I get as 0.000000214 etc.
Open in new window