Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Retreiving mailbox move history via Exchange remote session not working as expected

$
0
0

I'm trying to retrieve mailbox move history via a remote session and the results I'm getting are different then what I receive when running the command locally.

The powershell code I'm using is :

$user="<youruser>"

(get-mailbox $user | get-mailboxstatistics -IncludeMoveHistory).movehistory|select CompletionTimestamp,SourceDatabase,TargetDatabase

The code I'm using to set up the remote session is :

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<yourserver>/powershell

Import-PSSession $session -CommandName Get-MailboxStatistics,Get-Mailbox -AllowClobber

When executed locally I get the expected results.  Executing remotely does not.

Any idea what I am doing wrong? Thanks for all feedback!


Viewing all articles
Browse latest Browse all 6937

Trending Articles