Eventlog Sizes

List Eventlogsizes

# ----------------------------------------------------------------------------- 
# Script: HTML_EventlogSize.ps1 
# Usage: HTML_EventlogSize.ps1 -path "c:\test\Eventlogsize.html" -Servers <server1>,<Server2> -eventlogs Application,System
# Author: ed wilson, msft 
# Adjustments: Wessel van Sandwijk, Useful-it.nl
# ----------------------------------------------------------------------------- 
# Date: 09/24/2013
# Keywords: Scripting Techniques, Web Pages and HTAs 
# comments: Get-Wmiobject, New-Object, Get-Date, Convertto-HTML, Invoke-Item 
# ----------------------------------------------------------------------------- 


Function Get-EventlogSize 
{ Param ([string[]]$servers) 
  Foreach ($s in $servers)  
		Foreach ($l in $eventlogs)
				$os = Get-WmiObject -Class Win32_NTEventLogFile -cn $s -filter "LogFileName = '$l'"
        		$EventLogSize = $os.FileSize
				New-Object psobject -Property @{
        		FileSize = '{0:N0}' -f $eventLogSize;
				ReportDate =$(get-date)

# Entry Point *** 

Get-EventlogSize -servers $servers  
ConvertTo-Html -As Table -body " 
  <h1>Server EventlogSizes Report</h1> 
  The following report was run on $(get-date)" >> $path
  Invoke-Item $path


About the Author


I am a Technical Specialist - Cloud Infrastructures from the Netherlands. My Skills are mainly PowerShell, VMWare, Hyper-V, Microsoft System Center products and Windows Azure Pack. I work for a company in Utrecht The Netherlands.

No Comments

Comments are closed.