Tag Archives: event log

Measure max log-size on multiple servers

I got a little fuzzy case of how much disk all our server event-logs consume. Since the purchaser is still on vacation and couldn’t answer any questions I put together a 0.1 version with the old get-eventlog commandlet, depending on meeting with the purchaser I might replace it with the get-winevent that is a little more powerfull. The text displayed to the user is in Swedish since I´m working against swedes. First the script collects all servers in the active directory. After that I built the function get-logs that first collect all event-logs and then calculates the size of all logs and add the size and servername in an pscustomobject variable, it also adds the servers log size to the global variable $total to get a total size from all servers. I then use the function in an foreach loop with all the collected servers as targets. In the end it send a pop-up window to the user asking if he/she wants to export the result to an CSV-file. If you are interested in what the Swedish sentences means I recommend http://translate.google.com