Tuesday, February 19, 2008

Exchange2007: Messaging Record management

Requirement: All mail contents put in the Junk E-mail folder of Outlook 2007 will be kept for one day. After it passes the retention period, the messages will be moved to the deleted folder.
In the following diagram, Tom and John want to implement the automatic messaging content management.


Because it is the default folder: Junk E-mail, I define a new Managed Content Settings for the Junk E-mail.

[PS] C:\>New-ManagedContentSettings -name '1dayretention' -messageClass * -RetentionEnabled $True -AgeLimitForRetention 1 -RetentionAction MoveToDeletedItems -FolderName 'Junk E-mail'
[PS] C:\>New-ManagedFolderMailboxPolicy -Name JunkEmailFolder -ManagedFolderLinks 'Junk E-mail'


[PS] C:\>$password = Read-Host "Enter password" -AsSecureString


[PS] C:\>New-mailbox -UserPrincipalName Tom.Hicken@itsyou.com -alias THicken -database "First Storage Group\Mailbox Database" -Name Tom -OrganizationalUnit Users -password $password -FirstName 'tom' -LastName Hicken -DisplayName "Tom Hicken" -ResetPasswordOnNextLogon $false -ManagedFolderMailboxPolicy JunkEmailFolder -ManagedFolderMailboxPolicyAllowed


[PS] C:\>New-mailbox -UserPrincipalName John.Stephen@itsyou.com -alias JStephen -database "First Storage Group\Mailbox Database" -Name 'John Stephen' -OrganizationalUnit Users -password $password -FirstName John -LastName Stephen -DisplayName "John Stephen" -ResetPasswordOnNextLogon $false -ManagedFolderMailboxPolicy JunkEmailFolder -ManagedFolderMailboxPolicyAllowed


Outlook 2007 client--two profiles

The USN name should be used for the logon as shown below:

Open Outlook profile: Tom Hicken

Send an e-mail to both Tom.Hicken@itsyou.com and John.Stephen@itsyou.com;

Move the test mail from the Inbox to Junk E-mail folder;

Forward your computer clock 1 days + 10 minutes later;

[PS] C:\>Start-ManagedFolderAssistant

The test mail is automatically moved to Deleted Folder.


--------------

Remember to move your clock back.

--------------

How about Sam and Jim want to 2 day retention policy on their Junk E-mail folder?

[PS] C:\>New-ManagedFolder -Name 'A Junk' -DefaultFolderType 'JunkEmail' -Comment 'Unsolicited Commercial Email'

[PS] C:\>New-ManagedContentSettings -Name '2dayretention' -messageClass * -RetentionEnabled $True -AgeLimitForRetention 2 -RetentionAction MoveToDeletedItems -FolderName 'A Junk'

[PS] C:\>New-ManagedFolderMailboxPolicy -Name AJunkFolderPolicy -ManagedFolderLinks 'A Junk'

[PS] C:\>$password = Read-Host "Enter password" -AsSecureString

[PS] C:\>New-mailbox -UserPrincipalName Sam.Lion@itsyou.com -alias Slion -database "W2008\First Storage Group\Mailbox Database" -Name 'Sam Lion' -OrganizationalUnit Users -password $password -FirstName Sam -LastName Lion -DisplayName "Sam Lion" -ResetPasswordOnNextLogon $false -ManagedFolderMailboxPolicy AjunkFolderPolicy -ManagedFolderMailboxPolicyAllowed


[PS] C:\>New-mailbox -UserPrincipalName Jim.Jones@itsyou.com -alias JJones -database "W2008\First Storage Group\Mailbox Database" -Name 'Jim Jones' -OrganizationalUnit Users -password $password -FirstName Jim -LastName Jones -DisplayName "Jim Jones" -ResetPasswordOnNextLogon $false -ManagedFolderMailboxPolicy AjunkFolderPolicy -ManagedFolderMailboxPolicyAllowed

Create outlook profiles as:

Open Administrator profile and send a mail to Jim.Jones@itsyou.com and Sam.Lion@itsyou.com; Close the outlook;


Open Jim.Jones profile and move the e-mail from inbox to Junk E-mail box;


Move the Exchange Server 2007 clock 2 days +10 minutes later;


Start the Managed Folder Assistant;


[PS] C:\>Start-ManagedFolderAssistant


===============

How about you want some users have a Pending Approval folder. The users cannot remove the folder and any messages within will be automatically moved to Deleted Folder.

[PS] C:\>New-ManagedFolder -Name 'PendingApproval' -FolderName 'Pending Approval' -Comment 'All proposals must put in this folder'

[PS] C:\>New-ManagedContentSettings -Name '20dayretention' -messageClass * -RetentionEnabled $True -AgeLimitForRetention 20 -RetentionAction MoveToDeletedItems -FolderName 'PendingApproval'

[PS] C:\>new-ManagedFolderMailboxPolicy -Name 'JunkAndPending' -ManagedFolderLinks 'Junk E-mail','PendingApproval'

[PS] C:\>set-mailbox -Identity 'Tom Hicken' -ManagedFolderMailboxPolicy JunkAndPending -ManagedFolderMailboxPolicyAllowed

[PS] C:\>Start-ManagedFolderAssistant

Open Outlook as Tom Hicken;

You will find the Pending Approval folder under Managed Folder.

========================

Confusing parameter: FolderName

Used with New-ManagedFolder cmdLet

-FolderName parameter specifies the name of the folder as it will appear in users' mailboxes. You cannot set the FolderName value for managed default folders.

-Name parameter specifies a unique name for the folder.

Used with New-ManagedContentSettings cmdLet:


-FolderName parameter specifies the name or GUID of the managed folder to which the managed content settings apply --Unique ID of the folder

[PS] C:\>Get-ManagedFolder * Format-Table Name, FolderName




The Name column is the Unique ID of the managed folder. The following example shows that the value of FolderName parameter is 'Junk E-mail', which shows in the first column of the image. For the default managed folder, the Name and its FolderName are same. For the customized managed folder as shown above, the PendingApproval is the Unique ID and Pending Approval will show at Outlook client.