Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

need to send an email alert for just 1 individual mailbox

Posted on 2014-01-24
11
Medium Priority
?
594 Views
Last Modified: 2014-02-03
i need to send an email or alert when my journal mailbox either reaches a certian size or better still when it reaches a certain number of items in the inbox
0
Comment
Question by:dougdog
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 7

Expert Comment

by:peea
ID: 39806681
Are you talking about the client side running Microsoft Outlook?

If yes, the Outlook rules may help. Have a look at the following link for some hints.

http://www.wikihow.com/Manage-Email-Using-Microsoft-Outlook-Rules
0
 

Author Comment

by:dougdog
ID: 39806687
no some sort of script or something
rulea do not work for me
0
 
LVL 7

Expert Comment

by:peea
ID: 39806727
> some sort of script or something

You mean Exchange Server side scripting?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:dougdog
ID: 39806747
i dont care all i need is to be kept informed when the journal mailbox reaches a certain size
or certain number of items
i dont care how it does it as long as i get some sort of alert
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39807557
Hi, dougdog.

I could accomplish this with an Outlook macro, but there's a downside.  For the macro to work, you'll have to keep a computer running with Outlook open all the time.  The macro would watch for new items being delivered to the mailbox.  Each time a new item arrived, the macro would count the number of items and/or calculate how space the mailbox is using and send you an email if it goes over the limits you set.  If you closed Outlook, then the process would stop.  If leaving a computer on with Outlook open i s a problem, then one fallback position would be to write a script that would check periodically (e.g. once an hour).  You'd schedule the script to run using Windows Scheduler.  You could pick whatever interval you want.  If that's not good, then you're left with using an event-sink.  An event-sink is a script that runs at the Exchange server.  If that's the route you need to go, then I recommend that you hire a professional developer.  A poorly written, buggy event-sink could bring the entire server down.  They are best left to someone with experience in that arena.
0
 

Author Comment

by:dougdog
ID: 39807755
The schedule script sound's good
How could I achieve this
0
 
LVL 8

Expert Comment

by:EEhotline
ID: 39808065
Did you set up storage quota limit for mailbox in your exchange servers? If you do, you can create a transport rule.

Try:

a.      Launch EMC

b.      Expand to “Organization Configuration”>”Hub Transport”

c.       In the middle-pane, select “Transport Rules” and create a new rule

d.      In the wizard, set the rule as below:

Apply rule to message

When the Subject field contains The words in the subject of quota message

   And copy the message to Administrator

Notes: You can also add more conditions into the rule in order to scope more strictly on the messages.
0
 

Author Comment

by:dougdog
ID: 39809134
Tried this but for some reason doesnt work.
Also this only would send out 1 alert
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39809396
dougdog,

Do you want the item count/size for the entire mailbox (e.g. inbox, calendar, tasks) or just a single folder?  If the latter, what folder?
0
 

Author Comment

by:dougdog
ID: 39811871
all i need is the inbox
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 39818923
dougdog,

Here's the script.  Follow these instructions to use it.

1.  Open Notepad
2.  Copy the code and paste it into Notepad
3.  Edit the code per the comments I included in it
4.  Save the file.  Yoou can name it anything you want, but the extension must be .vbs
5.  Create a new task in Windows Task Scheduler
6.  Set the task to run this script
7.  Set the task to run at whatever interval you choose

The computer must be on for the task to run.  Outlook does not need to be open.  The script will open Outlook in the background and close it when it's done.  The task must be run under an account that has access to the mailbox you want to check.

'--> Create some constants
	'On the next line enter the name of the profile the mailbox is in
	Const PROFILE_NAME = "Outlook"
	'On the next line set the message count threshold. 
	Const MSG_COUNT_LIMIT = 500
	'On the next line set the message size threshold
	Const MSG_SIZE_LIMIT = 50000000
	'On the next line set the subject of the warning message the script will send if the mailbox is over either threshold
	Const WARNING_SUBJECT = "Mailbox Over Limit"
	'On the next line set the eamil address the warning message will go to if the mailbox is over either threshold
	Const WARNING_ADDRESS = "dougdog@company.com"
	Const SCRIPT_NAME = "Check Mailbox Size"
	Const olMailItem = 0
	Const olFormatPlain = 1
	Const olFolderInbox = 6

'--> Create some variables
	Dim olkApp, olkSes, olkFld, olkItm, olkMsg, varSiz, bolSiz, bolCnt
	
'--> Connect to Outlook
	Set olkApp = CreateObject("Outlook.Application")
	Set olkSes = olkApp.GetNamespace("MAPI")
	olkSes.Logon PROFILE_NAME
	Set olkFld = olkSes.GetDefaultFolder(olFolderInbox)
	
'--> Check the mailbox size and item count
	varSiz = 0
	For Each olkItm In olkFld.Items
		varSiz = varSiz + olkItm.Size
	Next
	bolSiz = (varSiz > MSG_SIZE_LIMIT)
	bolCnt = (olkFld.Items.Count > MSG_COUNT_LIMIT)
	If bolSiz Or bolCnt Then
		Set olkMsg = olkApp.CreateItem(olMailItem)
		With olkMsg
			.subject = WARNING_SUBJECT
			.to = WARNING_ADDRESS
			.bodyformat = olFormatPlain
			If bolSiz And bolCnt Then
				.body = "The mailbox is over both the size and count limits." & vbCrLf & vbCrLf & "Size: " & varSiz & vbCrLf & "Count: " & olkFld.Items.Count
			Else
				If bolSiz Then
					.body = "The mailbox is over the size limit." & vbCrLf & vbCrLf & "Size: " & varSiz
				Else
					If bolCnt Then
						.body "The mailbox is over the count limit." & vbCrLf & vbCrLf & "Count: " & olkFld.Items.Count
					End If
				End If
			End If
			.send
		End With
	End If
	
'--> Disconnect from Outlook
	Set olkMsg = Nothing
	Set olkItm = Nothing
	Set olkFld = nothing
	olkSes.Logoff
	Set olkSes = Nothing
	Set olkApp = Nothing

Open in new window

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question