locked
Cannot load Exchange Online Protection commands in Remote PowerShell RRS feed

  • Question

  • My colleagues and I cannot load the Exchange Online Protection commands in Remote PowerShell.

    It just loads the Exchange Online cmdlets.

    Where are we going wrong?

    PS C:\Users\jmorrison> $UserCredential = Get-Credential

    cmdlet Get-Credential at command pipeline position 1

    Supply values for the following parameters:

    PS C:\Users\jmorrison> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

    WARNING: Your connection has been redirected to the following URI: "https://outlook.office

    365.com/powershell-liveid?PSVersion=4.0&realm={I've removed my domain name for security reasons}.co.uk "

    PS C:\Users\jmorrison> Import-PSSession $Session

    ModuleType Version    Name                                ExportedCommands              

    ---------- -------    ----                                ----------------               

    Script     1.0        tmp_4fnmyflw.she                    {Add-AvailabilityAddressSpac...

    PS C:\Users\jmorrison> Get-TransportRule

    Get-TransportRule : The term 'Get-TransportRule' is not recognized as the name of a

    cmdlet, function, script file, or operable program. Check the spelling of the name, or

    if a path was included, verify that the path is correct and try again.

    At line:1 char:1

    + Get-TransportRule

    + ~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-TransportRule:String) [], CommandNotF

       oundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Friday, April 17, 2015 1:29 PM