The Office 365 automation tasks require the AzureAD PowerShell modules.

  • Open Windows PowerShell as an Administrator.

  • Enter the Get-Host command.

  • Ensure that Windows PowerShell version 5.1 or above is installed, if not download and install Windows PowerShell 5.1 or above

  • Install the AzureAD PowerShell modules by entering the following command.
    Install-Module -Name AzureAD 

  • If prompted to install the NuGet provider answer [Y]es.

  • If the error "WARNING: Unable to download the list of available providers. Check your internet connection." is seen then issue the following commands.

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    Register-PSRepository -Default -Verbose
    Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
    Install-Module -Name AzureAD

  • When connecting using Service Account (Client Secret) the Azure Az PowerShell Module must also be installed using the following command.

    Install-Module Az