de-DEen-GB
 
MVP - Most Valuable Professional
rss

Just can't get enough of IT

This blog is about mostly anything in IT. But the primary focuses are Microsoft Technologies like Exchange, Office 365, Azure and Cloud Security.
On January 13, 2018
0 Comment
667 Views
Last updated: 2018-01-15

Exchange Server 2013Exchange Server 2016Problem

When you migrate messages from alternative email solution (e.g. Lotus Notes) you might migrate sentitive content that must stay private in the new Exchange Server target location. 

So how can you mark such messages as private?

Solution

The privacy level (Sensitivity) of a mailbox item is controlled by MAPI extended property 0x36.

  • 0x36 = 0, sensitivity = normal
  • 0x36 = 2, sensitivity = private

The command line tool searches for messages containing a given text as a subject substring.

The c# code sets the extended property 0x36 to 2.

A mailbox is accessed using Exchange Web Services. The EWS endpoint is discovered using AutoDiscover for the selected mailbox.

The item modificatiuon is handled by the following code segment:

foreach (var extendedProperty in Message.ExtendedProperties)
{
	if (extendedProperty.PropertyDefinition == extendedPropertyDefinition)
	{
		if (log.IsInfoEnabled)
		{
			log.Info(string.Format("Try to alter the message: {0}", Message.Subject));
		}
		else
		{
			Console.WriteLine("Try to alter the message: {0}", Message.Subject);
		}

		// Set the value of the extended property to 0 (which is Sensitivity normal, 2 would be private)
		Message.ExtendedProperties[extendedPropertyindex].Value = 2;

		// Update the item on the server with the new client-side value of the target extended property
		Message.Update(ConflictResolutionMode.AlwaysOverwrite);
	}
	extendedPropertyindex++;
}

Usage

SetPrivateFlags.exe -mailbox user@domain.com -subject "[private]" 

Search the mailbox for all messages having a subject string containing [private] and ask for changing each item if -logonly is not set to true.
If -logonly is set to true only a log will be created.

 

SetPrivateFlags.exe -mailbox user@domain.com -subject "[private]" -noconfirmation

Search the mailbox for all messages having a subject string containing [private] and change all found messages without confirmation.

 

Note

It should be noted that this solution is intended for use in migration scenarios.

When providing access to mailbnox delegates you can enable access to your private elements as well. But access to shared mailboxes is not configured using the delegation workflow.

The code has been tested using Exchange Server 2013 CU15.

The program utilizes log4net to log detailed information to the file system. The configuration is controlled by the application's config file.

Updates

  • 2018-01-13: Release 1.0.0.0

Links

Any issues or feature requests? Use Github.

Like the code? Leave a note.

 

Read More »

Description

This script helps you to configure mailbox quotas for

  • ProhibitSendReceive
  • ProhibitSend
  • IssueWarning
  • ArchiveQuota
  • ArchiveWarningQuota

on a database level across all Exchange Server 2013/2016 databases in your environment or for a specific user.

Examples

Set all Exchange 2013/2016 databases to 1GB max mailbox size and use default percentage (90%/80%) for prohibit send and issue warning.

.\Set-MailboxQuota.ps1 -MaxMailboxSize 1GB -AllDatabases

 

Set max mailbox size to 10Gb for a dedicated user and use default percentage (90%/80%) for prohibit send and issue warning.

.\Set-MailboxQuota.ps1 -EmailAddress usera@mcsmemail.de -MaxMailboxSize 10GB

Version History

  • 1.0, Initial community release
  • 1.1, Archive support added
  • 1.2, Refactored to functions
  • 1.3, PowerShell hygiene
  • 1.4, Parameters reordered, PowerShell hygiene

Links

Last updated: 2017-04-20

 

Follow

 

 

Read More »