ExchangeOnline Import-Module ExchangePowershell error

Michael Freeman 5 Reputation points
2023-06-02T01:32:54.63+00:00

Hello,

I am trying to get Disable-DistributionGroup to work as we are trying to convert a distro list to a shared mailbox. I have been trying to get this to work for the last 2 days, searching for an answer but cannot seem to find it. I recently just upgraded to ExchangeOnlineManagement 3.1.0, also tried on 3.0.0. I can install the ExchangePowerShell but when i try to import it, it keeps giving me the following error listed below.

ExchangeOnlineManagement imports with no issue, any ideas on how to get past this issue is greatly appreciated.

PS C:\Windows\system32> Import-Module ExchangePowerShell
Import-Module : Exchange Server system variable ExchangeInstallPath missing.
At line:1 char:1
+ Import-Module ExchangePowerShell
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Exchange Server...llPath missing.:String) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : Exchange Server system variable ExchangeInstallPath missing.,Microsoft.PowerShell.Comman
   ds.ImportModuleCommand
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,368 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,298 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Aholic Liang-MSFT 13,826 Reputation points Microsoft Vendor
    2023-06-02T09:22:58.37+00:00

     

    Hi @ Michael Freeman,

    please refer to the commands to connect to the exchange online powershell with Global Administrator or Exchange Administrator:

     

     import-module ExchangeOnlineManagement
    
     Connect-ExchangeOnline -UserPrincipalName administratorxx@xx.ch
    

     

    After the connection is successful, you can run the relevant Exchange commands such as Disable-DistributionGroup .

    Here is a similar thread for you reference: import-module exchangepowershell throws exchangeinstallpath missing - Microsoft Q&A


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.