ExchangeOnline Import-Module ExchangePowershell error

Michael Freeman 5 Reputation points


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
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
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


    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


    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.