|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 9:52 AM
Points: 223,
Visits: 229
|
|
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.
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Today @ 2:38 PM
Points: 713,
Visits: 2,874
|
|
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 !"
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 9:52 AM
Points: 223,
Visits: 229
|
|
| Thanks a lot for script, I'll use it and get back to you surely
|
|
|
|