Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need a script for IIS log file size threshold limit exceed


Need a script for IIS log file size threshold limit exceed

Author
Message
Kumar-386306
Kumar-386306
SSC Veteran
SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)

Group: General Forum Members
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.
SQLQuest29
SQLQuest29
Right there with Babe
Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)Right there with Babe (746 reputation)

Group: General Forum Members
Points: 746 Visits: 4311
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 :-)
Kumar-386306
Kumar-386306
SSC Veteran
SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)SSC Veteran (233 reputation)

Group: General Forum Members
Points: 233 Visits: 246
Thanks a lot for script, I'll use it and get back to you surely
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search