Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Need a script for IIS log file size threshold limit exceed Expand / Collapse
Author
Message
Posted Thursday, February 21, 2013 10:01 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 26, 2013 3:12 AM
Points: 233, Visits: 246
Hi Guru,

if any have a power shell script to track the IIS log file size and send a email alert if the log file size exceeds certain limit.

Please share with it, as I'm new with writing power shell script or if there is any other alternative way which we achieve this requirement, kindly let me know.

thanks in advance.
Post #1422869
Posted Friday, February 22, 2013 9:45 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 1:43 PM
Points: 736, Visits: 3,693
Kumar-386306 (2/21/2013)
Hi Guru,

if any have a power shell script to track the IIS log file size and send a email alert if the log file size exceeds certain limit.

Please share with it, as I'm new with writing power shell script or if there is any other alternative way which we achieve this requirement, kindly let me know.

thanks in advance.


Hi,
This will help you
$File = Get-childitem "\\servername\folder\file.txt"
if ($File.Length -gt 10000) #change here to adjust your file threshold
#if condition is true .....
# new commandlet in V2 send-mailmessage
send-mailmessage -to "User01 <user01@example.com>" -from "ITGroup <itdept@example.com>" -cc "User02 <user02@example.com>" -bcc "ITMgr <itmgr@example.com>" -subject "Don't forget today's meeting!"
#if condition is false .. do noting ....



______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor
Post #1423136
Posted Friday, February 22, 2013 10:05 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 26, 2013 3:12 AM
Points: 233, Visits: 246
Thanks a lot for script, I'll use it and get back to you surely
Post #1423146
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse