Quantcast
Channel: Exchange Server 2013 - Setup, Deployment, Updates, and Migration 论坛
Viewing all articles
Browse latest Browse all 7008

MigrationBatch Status Property behaves differently when using imported PS-Session vs Exchange Mgmt Shell

$
0
0

I have discovered that when accessing the MigrationBatch.Status property from an imported PS-Session it is required to use the notation "MigrationBatch.Status.Value". However when accessing the same property from the Exchange Management Shell I only have to use Migration.Status.  This caused my script developed in the IDE to fail when run directly from the Server.  Here is the example:<o:p></o:p>

Note: I had screenshots but I could not post them.

Imported PS-Session<o:p></o:p>

$BatchStatus = Get-MigrationBatch 'testbatch1'
"$BatchStatus.Status" returns an object, while "$BatchStatus.Status.Value" returns a string.

Exchange Management Shell<o:p></o:p>

$BatchStatus = Get-MigrationBatch 'testbatch1'

"$BatchStatus.status" returns a string, while "$BatchStatus.status.value" returns $null.

I have not found another object that behaves this way yet in my travels.  My workaround is to use the ToString() method since that will return what I need in both environments.  I hope that is a local issue to this object. Just for grins I tried the same on the MigrationType property and it behaved the same way.

Figured I would post this for anyone that was receiving the same issue and if anyone has any insights.


Viewing all articles
Browse latest Browse all 7008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>