SOLVED

Exchange Online PowerShell V2 module Connect-ExchangeOnline CommandName switch

%3CLINGO-SUB%20id%3D%22lingo-sub-1294038%22%20slang%3D%22en-US%22%3EExchange%20Online%20PowerShell%20V2%20module%20Connect-ExchangeOnline%20CommandName%20switch%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1294038%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20limit%20the%20cmdlets%20that%20are%20retrieved%20when%20using%20the%26nbsp%3BExchange%20Online%20PowerShell%20V2%20module%3F%20Cmdlet%20Connect-ExchangeOnline%20does%20not%20appear%20to%20have%20the%20equivalent%20CommandName%20switch%20that%26nbsp%3BImport-PSSession%20has.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1294038%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%20PowerShell%20V2%20module%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1294820%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%20Online%20PowerShell%20V2%20module%20Connect-ExchangeOnline%20CommandName%20switch%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1294820%22%20slang%3D%22en-US%22%3E%3CP%3EWell%2C%20it's%20a%20%22wrapper%22%20cmdlet%2C%20it%20calls%20Import-PSSession%20internally.%20You%20can%20modify%20the%20corresponding%20script%20containing%20the%20cmdlet%2C%20which%20you%20can%20find%20under%3A%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EC%3A%5CProgram%20Files%5CWindowsPowerShell%5CModules%5CExchangeOnlineManagement%5CXXXX%5CExchangeOnlineManagement.psm1%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EOr%20you%20can%20do%20%22manual%22%20connectivity%20by%20getting%20a%20token%20directly%20and%20passing%20it%20to%20New-PSSession%20(although%20you%20will%20loose%20some%20functionalities).%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1296257%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%20Online%20PowerShell%20V2%20module%20Connect-ExchangeOnline%20CommandName%20switch%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1296257%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%2C%20So%20a%20parameter%20would%20have%20to%20be%20built-in...%20Is%20there%20a%20formal%20way%20to%20make%20that%20request%20to%20the%20devs%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1297519%22%20slang%3D%22en-US%22%3ERe%3A%20Exchange%20Online%20PowerShell%20V2%20module%20Connect-ExchangeOnline%20CommandName%20switch%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1297519%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20email%20them%20at%20the%20address%20listed%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fexchange%2Fexchange-online%2Fexchange-online-powershell-v2%2Fexchange-online-powershell-v2%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fexchange%2Fexchange-online%2Fexchange-online-powershell-v2%2Fexchange-online-powershell-v2%3Fview%3Dexchange-ps%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted
Best Response confirmed by mbromb (New 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).

Highlighted

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