Connect-AzureAD : The term ‘Connect-AzureAD’ is not recognized

Connect-AzureAD PowerShell error message

If you use PowerShell and try to connect to Azure AD you may see the following error mesage:

Connect-AzureAD : The term 'Connect-AzureAD' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ Connect-AzureAD
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Connect-AzureAD:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

This error message indicates that the AzureAD module for PowerShell is not loaded, and therefore the command “Connect-AzureAD” is not recognized.

Before you can use the AzureAD module, you need to install it by running the following command:

(make sure to run it as Administrator – read more about PowerShell module load order and advanced troubleshooting here)

Install-Module AzureAD

You may receive the following message:

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

Type Y and press enter to have the module downloaded and installed.

You should now be able to connect to Azure AD and start managing your Azure AD user accounts and resources:

PS C:\> Connect-AzureAD
Account                              Environment TenantId                             TenantDomain            AccountType
-------                              ----------- --------                             ------------            -----------
morten@skrubbeltrang.onmicrosoft.com AzureCloud  a7702c47-b35d-4700-bf01-e1ae5e6c441f azure.skrubbeltrang.com User
PS C:\>

Manage Office 365 Users and Licenses Without PowerShell

If you’re looking for a faster and more efficient way to manage your Office 365 users, licenses, and mailboxes, you should have a look at Easy365Manager.

With Easy365Manager, you can directly manage Office 365 users and mailboxes in the Active Directory Users & Computers management console.

Easy365Manager is a snap-in that extends the user and group properties in AD Users & Computers.

As seen here, with Easy365Manager, you have direct and easy access to configure the Office 365 licenses of your AD users from the familiar Active Directory admin tool:

Create an Office 365 mailbox using Easy365Manager

For a complete list of features in Easy365Manager, have a look at this.

You can download a fully functional 30-day trial here.

AzureAD Module PowerShell Commands

If you want to know what commands are available in the AzureAD PowerShell module, use the following command.

PS C:\>  (Get-Module -Name AzureAD).ExportedCommands | ft key
Key
---
Add-AzureADApplicationOwner
Add-AzureADDeviceRegisteredOwner
Add-AzureADDeviceRegisteredUser
Add-AzureADDirectoryRoleMember
Add-AzureADGroupMember
Add-AzureADGroupOwner
Add-AzureADMSAdministrativeUnitMember
Add-AzureADMSApplicationOwner
Add-AzureADMSLifecyclePolicyGroup
Add-AzureADMSScopedRoleMembership
Add-AzureADMSServicePrincipalDelegatedPermissionClassification
Add-AzureADServicePrincipalOwner
Confirm-AzureADDomain
Connect-AzureAD
Disconnect-AzureAD
Enable-AzureADDirectoryRole
Get-AzureADApplication
Get-AzureADApplicationExtensionProperty
Get-AzureADApplicationKeyCredential
Get-AzureADApplicationLogo
Get-AzureADApplicationOwner
Get-AzureADApplicationPasswordCredential
Get-AzureADApplicationProxyApplication
Get-AzureADApplicationProxyApplicationConnectorGroup
Get-AzureADApplicationProxyConnector
Get-AzureADApplicationProxyConnectorGroup
Get-AzureADApplicationProxyConnectorGroupMember
Get-AzureADApplicationProxyConnectorMemberOf
Get-AzureADApplicationServiceEndpoint
Get-AzureADContact
Get-AzureADContactDirectReport
Get-AzureADContactManager
Get-AzureADContactMembership
Get-AzureADContactThumbnailPhoto
Get-AzureADContract
Get-AzureADCurrentSessionInfo
Get-AzureADDeletedApplication
Get-AzureADDevice
Get-AzureADDeviceConfiguration
Get-AzureADDeviceRegisteredOwner
Get-AzureADDeviceRegisteredUser
Get-AzureADDirectoryRole
Get-AzureADDirectoryRoleMember
Get-AzureADDirectoryRoleTemplate
Get-AzureADDomain
Get-AzureADDomainNameReference
Get-AzureADDomainServiceConfigurationRecord
Get-AzureADDomainVerificationDnsRecord
Get-AzureADExtensionProperty
Get-AzureADGroup
Get-AzureADGroupAppRoleAssignment
Get-AzureADGroupMember
Get-AzureADGroupOwner
Get-AzureADMSAdministrativeUnit
Get-AzureADMSAdministrativeUnitMember
Get-AzureADMSApplication
Get-AzureADMSApplicationExtensionProperty
Get-AzureADMSApplicationOwner
Get-AzureADMSAuthorizationPolicy
Get-AzureADMSConditionalAccessPolicy
Get-AzureADMSDeletedDirectoryObject
Get-AzureADMSDeletedGroup
Get-AzureADMSGroup
Get-AzureADMSGroupLifecyclePolicy
Get-AzureADMSGroupPermissionGrant
Get-AzureADMSIdentityProvider
Get-AzureADMSLifecyclePolicyGroup
Get-AzureADMSNamedLocationPolicy
Get-AzureADMSPermissionGrantConditionSet
Get-AzureADMSPermissionGrantPolicy
Get-AzureADMSRoleAssignment
Get-AzureADMSRoleDefinition
Get-AzureADMSScopedRoleMembership
Get-AzureADMSServicePrincipalDelegatedPermissionClassification
Get-AzureADOAuth2PermissionGrant
Get-AzureADObjectByObjectId
Get-AzureADServiceAppRoleAssignedTo
Get-AzureADServiceAppRoleAssignment
Get-AzureADServicePrincipal
Get-AzureADServicePrincipalCreatedObject
Get-AzureADServicePrincipalKeyCredential
Get-AzureADServicePrincipalMembership
Get-AzureADServicePrincipalOAuth2PermissionGrant
Get-AzureADServicePrincipalOwnedObject
Get-AzureADServicePrincipalOwner
Get-AzureADServicePrincipalPasswordCredential
Get-AzureADSubscribedSku
Get-AzureADTenantDetail
Get-AzureADTrustedCertificateAuthority
Get-AzureADUser
Get-AzureADUserAppRoleAssignment
Get-AzureADUserCreatedObject
Get-AzureADUserDirectReport
Get-AzureADUserExtension
Get-AzureADUserLicenseDetail
Get-AzureADUserManager
Get-AzureADUserMembership
Get-AzureADUserOAuth2PermissionGrant
Get-AzureADUserOwnedDevice
Get-AzureADUserOwnedObject
Get-AzureADUserRegisteredDevice
Get-AzureADUserThumbnailPhoto
Get-CrossCloudVerificationCode
New-AzureADApplication
New-AzureADApplicationExtensionProperty
New-AzureADApplicationKeyCredential
New-AzureADApplicationPasswordCredential
New-AzureADApplicationProxyApplication
New-AzureADApplicationProxyConnectorGroup
New-AzureADDevice
New-AzureADDomain
New-AzureADGroup
New-AzureADGroupAppRoleAssignment
New-AzureADMSAdministrativeUnit
New-AzureADMSApplication
New-AzureADMSApplicationExtensionProperty
New-AzureADMSApplicationKey
New-AzureADMSApplicationPassword
New-AzureADMSConditionalAccessPolicy
New-AzureADMSGroup
New-AzureADMSGroupLifecyclePolicy
New-AzureADMSIdentityProvider
New-AzureADMSInvitation
New-AzureADMSNamedLocationPolicy
New-AzureADMSPermissionGrantConditionSet
New-AzureADMSPermissionGrantPolicy
New-AzureADMSRoleAssignment
New-AzureADMSRoleDefinition
New-AzureADServiceAppRoleAssignment
New-AzureADServicePrincipal
New-AzureADServicePrincipalKeyCredential
New-AzureADServicePrincipalPasswordCredential
New-AzureADTrustedCertificateAuthority
New-AzureADUser
New-AzureADUserAppRoleAssignment
Remove-AzureADApplication
Remove-AzureADApplicationExtensionProperty
Remove-AzureADApplicationKeyCredential
Remove-AzureADApplicationOwner
Remove-AzureADApplicationPasswordCredential
Remove-AzureADApplicationProxyApplication
Remove-AzureADApplicationProxyApplicationConnectorGroup
Remove-AzureADApplicationProxyConnectorGroup
Remove-AzureADContact
Remove-AzureADContactManager
Remove-AzureADDeletedApplication
Remove-AzureADDevice
Remove-AzureADDeviceRegisteredOwner
Remove-AzureADDeviceRegisteredUser
Remove-AzureADDirectoryRoleMember
Remove-AzureADDomain
Remove-AzureADGroup
Remove-AzureADGroupAppRoleAssignment
Remove-AzureADGroupMember
Remove-AzureADGroupOwner
Remove-AzureADMSAdministrativeUnit
Remove-AzureADMSAdministrativeUnitMember
Remove-AzureADMSApplication
Remove-AzureADMSApplicationExtensionProperty
Remove-AzureADMSApplicationKey
Remove-AzureADMSApplicationOwner
Remove-AzureADMSApplicationPassword
Remove-AzureADMSApplicationVerifiedPublisher
Remove-AzureADMSConditionalAccessPolicy
Remove-AzureADMSDeletedDirectoryObject
Remove-AzureADMSGroup
Remove-AzureADMSGroupLifecyclePolicy
Remove-AzureADMSIdentityProvider
Remove-AzureADMSLifecyclePolicyGroup
Remove-AzureADMSNamedLocationPolicy
Remove-AzureADMSPermissionGrantConditionSet
Remove-AzureADMSPermissionGrantPolicy
Remove-AzureADMSRoleAssignment
Remove-AzureADMSRoleDefinition
Remove-AzureADMSScopedRoleMembership
Remove-AzureADMSServicePrincipalDelegatedPermissionClassification
Remove-AzureADOAuth2PermissionGrant
Remove-AzureADServiceAppRoleAssignment
Remove-AzureADServicePrincipal
Remove-AzureADServicePrincipalKeyCredential
Remove-AzureADServicePrincipalOwner
Remove-AzureADServicePrincipalPasswordCredential
Remove-AzureADTrustedCertificateAuthority
Remove-AzureADUser
Remove-AzureADUserAppRoleAssignment
Remove-AzureADUserExtension
Remove-AzureADUserManager
Reset-AzureADMSLifeCycleGroup
Restore-AzureADDeletedApplication
Restore-AzureADMSDeletedDirectoryObject
Revoke-AzureADSignedInUserAllRefreshToken
Revoke-AzureADUserAllRefreshToken
Select-AzureADGroupIdsContactIsMemberOf
Select-AzureADGroupIdsGroupIsMemberOf
Select-AzureADGroupIdsServicePrincipalIsMemberOf
Select-AzureADGroupIdsUserIsMemberOf
Set-AzureADApplication
Set-AzureADApplicationLogo
Set-AzureADApplicationProxyApplication
Set-AzureADApplicationProxyApplicationConnectorGroup
Set-AzureADApplicationProxyApplicationCustomDomainCertificate
Set-AzureADApplicationProxyApplicationSingleSignOn
Set-AzureADApplicationProxyConnector
Set-AzureADApplicationProxyConnectorGroup
Set-AzureADDevice
Set-AzureADDomain
Set-AzureADGroup
Set-AzureADMSAdministrativeUnit
Set-AzureADMSApplication
Set-AzureADMSApplicationLogo
Set-AzureADMSApplicationVerifiedPublisher
Set-AzureADMSAuthorizationPolicy
Set-AzureADMSConditionalAccessPolicy
Set-AzureADMSGroup
Set-AzureADMSGroupLifecyclePolicy
Set-AzureADMSIdentityProvider
Set-AzureADMSNamedLocationPolicy
Set-AzureADMSPermissionGrantConditionSet
Set-AzureADMSPermissionGrantPolicy
Set-AzureADMSRoleDefinition
Set-AzureADServicePrincipal
Set-AzureADTenantDetail
Set-AzureADTrustedCertificateAuthority
Set-AzureADUser
Set-AzureADUserExtension
Set-AzureADUserLicense
Set-AzureADUserManager
Set-AzureADUserPassword
Set-AzureADUserThumbnailPhoto
Update-AzureADSignedInUserPassword
Get-AzureADApplicationProxyConnectorGroupMembers
Did you like this post? Maybe your friends will too!