Tag Archives: log

Move log files according to file name to separate folder

Here is the link for the script I am using for automatic moving log files to separate folder according to them name (Version 2.0).

According to file name…

The script is wrote in powershell.

It is can be run from command line like schedule task: “C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -command”

Download the Script and rename the suffix from .txt to .ps1

On the first section you need to feel relevant data for your logs and temporary file to use (change the brackets to relevant data, NO NEED BRACKETS!!!):

$path1 = “[Folder to look for logs]”
$csvfile1 = “[Temporary CSV file]”

I will be glade to get suggestions…

Thanks

Tal

Zip event logs files and move to other location

Here is the link for the script I am using zip event logs files and move to other location (Version 1.0).

The script is wrote in powershell.

It is can be run from command line like schedule task: “C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -command”

Download the Script and rename the suffix from .txt to .ps1

On the first section you need to feel relevant data for your needs and you servers to check (change the brackets to relevant data, NO NEED BRACKETS!!!):

$ComputerName = (“Server1″,”Server2″,”Server3″,”Server4”)
$Syslogs = “[File location to move to…]”
$Path2003 = “c$WINDOWSsystem32config”
$Path2008 = “c$WINDOWSSystem32WinevtLogs”
$sender = “Script@[domain].com”
$subject1 = “Archive Security Event Log”
$smtpsrv = “[SMTPSERVER]”
$Recepionist = “xxx@[domain].com”
$filter1 = “Archive*.evt”
$Source = “Archive-Security”
$Dest = “sec”

I will be glade to get suggestions…

Thanks

Tal