Avatar of Albert Widjaja
Albert Widjaja
Flag for Australia asked on

Exchange Server 2013 Message Tracking log Powershell ?

Hi All,

I've got 5x mailbox servers spread across different data centers.

Previously I used to able using my Powershell IDE from my laptop to get the Message Tracking log from ALL Exchange 2010 HubTransport server. But now I wonder what could be the change for Exchange Server 2013 ?

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://PRODHTCAS-02-VM/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -AllowClobber
Import-Module ActiveDirectory -ErrorAction STOP

Get-TransportServer | Get-Messagetrackinglog -Sender "emite@domain.com" -Recipients "itoperat@domain.com" -EventID "RECEIVE" -Start "25/01/2017 9:00:00 AM" -End "25/03/2016 9:08:00 PM" | ft -wrap Timestamp, Source, Sender, Recipients, MessageSubject, TotalBytes | Out-GridView

Open in new window


Do I have to run that command above for each mailbox server now in 2013 ?

This is the error message I'm getting, I'm just copy pasting one erro message since it is repeated for the number of my mailbox server:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo          : InvalidArgument: (PRODMBX02-VM:PSObject) [Get-MessageTrackingLog], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Get-MessageTrackingLog
    + PSComputerName        : PRODMBXCAS04-VM

Open in new window


Note: PRODMBXCAS04-VM is where I usually connect for PowerShell remoting.

Any help would be greatly appreciated.

Thanks,
PowershellExchangeActive DirectoryScripting LanguagesMicrosoft 365

Avatar of undefined
Last Comment
Albert Widjaja

8/22/2022 - Mon
SOLUTION
Wasim Shaikh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Albert Widjaja

ASKER
I get this error message :

Cannot validate argument on parameter 'Server'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again

Open in new window


even after changing the script into:
Get-TransportService | Get-Messagetrackinglog -Server $_.ServerName -Sender .....

Open in new window

Wasim Shaikh

get-transportservice or get-transportserver?
when you run get-transportserver, what property object refers to server name?
Albert Widjaja

ASKER
Same thing.
ServerName
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Mohammad Ishtyaq khatri

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Albert Widjaja

ASKER
Hi Mik,

I have export the result to single .CSV file ?

| Export-CSV -Path ....

However, it seems that the result is duplicated after opening it up in Excel.

Upon running the "Remove Duplicate" function from Excel, the result is the same as running the first script.

So does this means that the first Powershell script is enough to execute for ALL mailbox servers role ?
SOLUTION
Jason Crawford

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Albert Widjaja

ASKER
Jason, does it works for Exchange Server 2013 ?

I'm using Powershell IDE on my laptop to execute the Exchange PowerShell, so I begin my script with:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://PRODMBX02-VM/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -AllowClobber
Import-Module ActiveDirectory -ErrorAction STOP
# then the Powershell goes here below....

Open in new window

SOLUTION
Jason Crawford

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Mohammad Ishtyaq khatri

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Albert Widjaja

ASKER
Thanks !
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.