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: Yesterday @ 10:10 AM
Points: 232, Visits: 242
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


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 10:31 AM
Points: 713, Visits: 2,974
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,
Cheers !

"Never take life too seriously, nobody gets out of it anyways !
When your love and skills unite, expect a masterpiece !"
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: Yesterday @ 10:10 AM
Points: 232, Visits: 242
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