SOLVED

Exchange Online PowerShell V2 module Connect-ExchangeOnline CommandName switch

Copper Contributor

Is there a way to limit the cmdlets that are retrieved when using the Exchange Online PowerShell V2 module? Cmdlet Connect-ExchangeOnline does not appear to have the equivalent CommandName switch that Import-PSSession has.

3 Replies
best response confirmed by mbromb (Copper Contributor)
Solution

Well, it's a "wrapper" cmdlet, it calls Import-PSSession internally. You can modify the corresponding script containing the cmdlet, which you can find under: C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\XXXX\ExchangeOnlineManagement.psm1

 

Or you can do "manual" connectivity by getting a token directly and passing it to New-PSSession (although you will loose some functionalities).

@Vasil Michev , So a parameter would have to be built-in... Is there a formal way to make that request to the devs?

1 best response

Accepted Solutions
best response confirmed by mbromb (Copper Contributor)
Solution

Well, it's a "wrapper" cmdlet, it calls Import-PSSession internally. You can modify the corresponding script containing the cmdlet, which you can find under: C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\XXXX\ExchangeOnlineManagement.psm1

 

Or you can do "manual" connectivity by getting a token directly and passing it to New-PSSession (although you will loose some functionalities).

View solution in original post