Solved

need to send an email alert for just 1 individual mailbox

Posted on 2014-01-24
11
559 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 500 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

825 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