Author Posts

May 15, 2018 at 12:02 pm

Is there a way, or a work around to enable remoting for exchange.

Maybe I dont explain myself the right way. When remoting to exchange server using import-pssession, a lot of command dont work the way they work in a exchange PowerShell. Serialisation, deserialisation, full language, I didnt a lot of research but hard to get it working as if I was in exchange shell.

I do a lot of exchange migration, my goal was to do remoting form my laptop, having everything ready on my machine. most of the command I found here and there dont work in a remote session.

An example : for public folder migration, we can export information before we begin, the first 2 command work well
Get-PublicFolder -Recurse | Export-CliXML C:\PFMigration\Legacy_PFStructure.xml
Get-PublicFolderStatistics | Export-CliXML C:\PFMigration\Legacy_PFStatistics.xml

The following ran in an error
Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\PFMigration\Legacy_PFPerms.xml

I know it related to deserialization, I am seeking for a good practice advise. How I can work around this.

Thank

May 15, 2018 at 12:26 pm

Are you remoting into the exchange box and then running the commands or are you doing something like this?

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/PowerShell/ -Authentication Kerberos
Import-PSSession $Session

May 15, 2018 at 12:40 pm

Yes exactly this. Lot of limitation, by design. I try the full language mode, same thing.

May 15, 2018 at 12:50 pm

If you modify your command to this what happens?

Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User | Export-CliXML C:\PFMigration\Legacy_PFPerms.xml

From my recollection you cannot use select with -expand property on multiple items

See these:

https://powershell.org/forums/topic/how-to-use-expandproperty-for-multiple-properties/
and
https://powershell.org/forums/topic/select-expandproperty-and-other-attributes/

May 15, 2018 at 3:14 pm

The command break at Get-PublicFolder -Recurse | Get-PublicFolderClientPermission

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.

As said, in Exchange shell, it work. It does work also on an Exchange 2016 via remoting.

Why Exchange 2010 in remoting?

May 15, 2018 at 3:27 pm

We migrated from EX2010 to O365 and I ran something along those lines to get permissions and didn't have any problems. I did everything remote as well, no work done on the exchange box/shell.

Looking back at my notes (can't believe I kept this! We migrated over 18 months ago) I found this:

Get-MailPublicFolder | Get-ADPermission | where {$_.extendedrights -like '*send-as*'} | select identity, user

Try modifying that to suit your needs.