AzureADPreview module error (Solved)

Share This Post

Trying to Install-Module AzureADPreview but Get-PSRepository “WARNING: Unable to find module repositories.”

If you want to restrict the creation of groups for your organization you will need to run a number of PowerShell scripts. In these scripts you use the new AzureADPreview module.

Only during the installation something goes wrong because this module cannot be found in the PowerShell repository. How can you solve this?

In fact there is one golden solution here, namely to adjust your TLS settings, execute the following command and you will notice that the module can be installed correctly.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

After that it is best to run the following command, this command ensures that if you already have an earlier version of AzureAD commands installed they will not be impacted and the new module will be installed as a new “shell” on your system.

Install-Module AzureADPreview -Force -AllowClobber

Conclusion:

After a very simple fix you can install the AzureADPreview module and continue working on your project in combination with Azure AD.

Links:

  1. https://techcommunity.microsoft.com/t5/windows-powershell/trying-to-install-module-azuread-but-get-psrepository-quot/m-p/202819
  2. https://docs.microsoft.com/en-us/microsoft-365/admin/create-groups/manage-creation-of-groups?view=o365-worldwide

More To Explore

Azure Security: A comprehensive overview

As organizations continue to embrace cloud computing, securing digital assets in the cloud has become a top priority. Microsoft Azure, one of the leading cloud

What is Cloud Security?

Welcome to the world of Cloud Security! Or better Hybrid-Cloud Security. If you’ve ever wondered how your data stays safe as it floats around in