Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag 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,
SOLUTION
Avatar of Wasim Shaikh
Wasim Shaikh
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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

get-transportservice or get-transportserver?
when you run get-transportserver, what property object refers to server name?
Same thing.
ServerName
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks !