(It doesn't have to be elevated.) Office 365 cloudĬonnect-AzureAD -AzureEnvironmentName AzureChinaCloudĬonnect-AzureAD -AzureEnvironmentName AzureGerman圜loud To connect to Azure Active Directory (Azure AD) for your Microsoft 365 subscription with an account name and password or with multi-factor authentication, run one of these commands from a Windows PowerShell command prompt. Step 2: Connect to Azure AD for your Microsoft 365 subscription Run this command to import the module: Import-Module AzureAD Yes Yes to All No No to All Suspend Help (default is 'N'):Īnswer Yes or Yes to All to continue with the installation. If you trust this repository, change its InstallationPolicy value by running the `Set-PSRepository` cmdlet.Īre you sure you want to install the modules from 'PSGallery'? You are installing the modules from an untrusted repository. The first time you use the PSGallery, you'll see the following message: Untrusted repository Run this command: Install-Module -Name AzureADīy default, the PowerShell Gallery (PSGallery) isn't configured as a trusted repository for PowerShellGet. Open a Windows PowerShell Command Prompt window. But you'll likely need to update the software periodically. These steps are required only one time on your computer. For information about support for different versions of Windows, see Azure Active Directory PowerShell for Graph module.