Solved

exchange recipient policies

Posted on 2014-04-25
1
187 Views
Last Modified: 2014-05-07
Hi there, i have a cluster of users i need to do policies on in exchange. the scenario

After 5 o clock, this cluster of users i do not want to be able to receive mail from anyone except a select few employees. Then at 7 o clock the next morning they can begin receiving mail from everyone again.
0
Comment
Question by:mrbayIt
1 Comment
 
LVL 37

Accepted Solution

by:
Jamie McKillop earned 500 total points
ID: 40027181
Hello,

First, create two distribution groups; one for the users you want to set the restrictions on ("Restricted Users") and one for the users you want to be able to send to these users after 5 ("Allowed Senders").

The second step is to create a transport rule. You would use the following syntax:

New-TransportRule "Block Messages After 5" -SentToMemberOf "Restricted Users" -RejectMessageEnhancedStatusCode "5.7.1" -RejectMessageReason "This user is not permitted to receive email messages between 5PM and 7AM" -ExceptifFromMemberOf "Allowed Senders"

Run the following command to disable the rule:

Disable-TransportRule "Block Messages After 5"

Now, create two .ps1 files on your server. The first will be called "EnableTR.ps1" and the content will be:

Enable-TransportRule "Block Messages After 5"

The second one will be called "DisableTR.ps1" and the content will be"

Disable-TransportRule "BlockMessages After 5"

Now, create two batch files. The first will be called "EnableTR.bat" and the content will be:

powershell -command "& 'c:\EnableTR.ps1' "

The second one will be called "EnableTR.ps1" and the content will be:

powershell -command "& 'c:\DisableTR.ps1' "

Now, in Task Scheduler, schedule EnableTR.bat to run at 5PM and schedule DisableTR.bat to run at 7AM.

-JJ
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Read this checklist to learn more about the 15 things you should never include in an email signature.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
how to add IIS SMTP to handle application/Scanner relays into office 365.

770 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