May 12, 2012

Message tracking, export list of recipients

A while ago, I needed to find the recipients of a message sent out to a distribution list. Simple enough task until you realize that the Distribution list recipients may have been compromised at the time the message was sent to it.
An accurate way of getting a list of exactly who was sent the message at the time is to run a cmdlet which will export all of the recipients that received the message to a csv file.
If you do not have EDGE servers just remove: |? {-NOT $_.Name.Contains("EDGE")}
All other input (sender, subject and time, file location), you will have to change for your own message tracking are in red.

Get-transportserver | ? {-NOT $_.Name.Contains("EDGE")} | Get-MessageTrackinglog -ResultSize unlimited -Sender -MessageSubject "SUBJECT" -Start "MM/DD/YYYY HH:MMPM" | Select Sender, @ {N="Recipients";E={$_.Recipients}}, MessageSubject, MessageID, RecipientCount, RelatedRecipientAddress, Client*, Server*,EventID,Time* | Export-CSV -Encoding "ASCII" C:\users\<username>\desktop\new_MSG-TrackingResult.csv -Notype

May 7, 2012

'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program

When attempting to export a mailbox to pst, if you are faced with an error in Powershell with

“The Term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program” this indicates that you have not been provisioned with the role."

You need to run the New-ManagementRoleAssignment cmdlet to assign the role to be able to import and export

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User <domain>\<username>

New-ManagementRoleAssignment –Role “Mailbox Import Export” –User mydomain\Tyger

1: Assign the permission

New-managementroleassignment –role “mailbox import export” –user <Domain>\<your adm account> 
New-managementroleassignment –role “mailbox import export” –user mydomain\Tyger


2: Then you will be able to run the export cmdlet (save to local path in this cmdlet)

New-MailboxExportRequest <username> -Filepath \\<server>\location\<filename>.pst
New-mailboxEportRequest jsmith -Filepath \\exchange1\pst_files\jsmith.pst

3: Follow the .pst export progress

Get-MailboxExportRequest | Get-MailboxExportRequestStatistics

4: When the export reaches 100%, you will need to remove the pst move request from the queue.

Get-MailboxExportRequest | Remove-MailboxExportRequest

If you are running multiple moves and would like to remove all the completed requests:

Get-MailboxExportRequest | ? {$_.status -eq 'complete'} | Remove-

May 6, 2012

Attachment does not show in Outlook 2010, but shows in Outlook 2003

How to restore attachments for Multi-part related messages in exchange 2010.

An unique issue was discovered when receiving “Multi-part related messages” when sent to 2 users on differing exchange versions (E2003 and E2010). Discovered with Exchange 2003 - 2010 coexistence environment.

The Symptoms: A user with Exchange 2010 mailbox will not see the attachments but when they forward the message, the attachment will appear. The same user will be able to see the attachments in OWA, however, only if they are not using conversation view.
A user on Exchange 2003 will see the attachment and can forward without issues.

The Cause: These type of emails come to us in this format. Headers from mailgate will show that there is an attachment, yet the headers will show that there isn’t an attachment via the “X-MS-Has-Attach:”  parameter being blank and showing content as “yes” on exchange 2003 mailboxes.
In this case, the reason the attachment was hidden in Outlook was because of 2 things:
1. Content-Type: multipart/related - Outlook is unable to display attachments that have this content-type

The Resolution: Give yourself full mailbox access to the users account. Open MFCMAPI.exe (you can download this from 
NB: Only run MFCMAPI.exe if you are experienced with this tool. It is a powerful tool to work with. I ran this under Microsofts instruction.

Run this and when open go to Session> Logon and display Store table>

(select your profile name in the next box)

Double click on the profile name. EG: Matthew Robertson.

A new dialogue box will open. Drill down to Root Container> Top of information store > Inbox (double click).

Locate the email in the inbox folder and sort the property Names. Locate “PR_ATTACHMENT_HIDDEN = True
(NB: because I have already done this change, for this example we will need to access another field “PR_HASATTACH” because the prior field has changed and is now removed.) “PR_HASATTACH” double click on this property.

Check the Boolean box, click OK.

Close out of MFCMAPI. Restart Outlook and check to make sure the attachments have appeared in the email. Paperclip icon might not be showing, but your attachments will.

The Permanent Resolution: As Microsoft says this is a known issue to them and there is a configuration change we can make on Exchange 2010 to make sure that future “Multi-part related messages” will show in exchange 2010, IE: To permanently set the value of "TreatInlineDispositionAsAttachment" as “True”

Exchange Server 2010
1.      Stop the Exchange Transport service.
2.      Locate the EdgeTransport.exe.config file. This file is located in the following path: 
<drive> :\Program Files\Microsoft\Exchange Server\Bin\
3.      In the EdgeTransport.exe.config file, add the following entry between the <appSettings> element and the </appSettings> element:
<add key="TreatInlineDispositionAsAttachment" value="true" />
4.      Restart the Transport service.