Solved

exchange recipient policies

Posted on 2014-04-25
1
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
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…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

623 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