Solved

Exchange Message Tracking Powershell Error

Posted on 2016-08-12
5
36 Views
Last Modified: 2016-08-13
I'm trying to track message on exchange 2010, but am getting the following error using the "&" character.  and getting the error below.  Is there any way around this?

Get-Transportserver | Get-MessageTrackingLog -recipients Test&Email@comcast.net -Start "08/11/2016 11:00:00" -End "08/12/2016 12:00:00" | Select-Object eventid,sender,timestamp,@{Name="Recipients";Expression=$_.recipients}},@Name="RecipientStatus";Expression={$_.recipientstatus}},messagesubject | ConvertTo-Html > "g:\temp\message
track.html"


Error:
& : Ampersand not allowed. The & operator is reserved for future use; use "&" to pass ampersand as a string.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : AmpersandNotAllowed
0
Comment
Question by:Rob Shorts
5 Comments
 
LVL 16

Expert Comment

by:FOX
Comment Utility
try entering the command like this         -recipients Test"&"Email@comcast.net
1
 
LVL 38

Accepted Solution

by:
Adam Brown earned 250 total points
Comment Utility
Put the quotes around the entire email address if there are special characters in it.
2
 
LVL 16

Assisted Solution

by:FOX
FOX earned 250 total points
Comment Utility
just like Adam Brown stated              -recipients 'Test&Email@comcast.net'
1
 

Author Closing Comment

by:Rob Shorts
Comment Utility
Thank you
0
 
LVL 7

Expert Comment

by:Senior IT System Engineer
Comment Utility
What's the difference between single quote and double quote ?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will help you understand what HashTables are and how to use them in PowerShell.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
how to add IIS SMTP to handle application/Scanner relays into office 365.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now