Sunday 20 April 2014

Save and clear Eventlogs

Hello friends

This time i am posting "How to save and clear Eventlogs"

if most of your production servers are running on VM (virtualmachines) the space on OS drive (C) may reach above threshhold in that case you need to
clear some space.we can clear temp files and compress some logs.apart doing
all these we can create a powershellscript to save and clear eventlogs.


$applog=Get-WmiObject win32_nteventlogfile -Filter "logfilename = 'application'"
$date=Get-Date -Format ("dd-MM-yyy-mm-ss")
$applog.backupeventlog("d:\Applicationlog_$date.evtx")
$applog=Get-WmiObject win32_nteventlogfile -Filter "logfilename ='system'"
$applog.backupeventlog("d:\systemlog_$date.evtx")

Clear-EventLog -Log application,system






 

Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress

#Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress # use...