{"id":4211,"date":"2020-01-12T15:17:03","date_gmt":"2020-01-12T20:17:03","guid":{"rendered":"https:\/\/adsecurity.org\/?p=4211"},"modified":"2020-01-19T19:09:36","modified_gmt":"2020-01-20T00:09:36","slug":"what-is-azure-active-directory","status":"publish","type":"post","link":"https:\/\/adsecurity.org\/?p=4211","title":{"rendered":"What is Azure Active Directory?"},"content":{"rendered":"\n<p>Many are familiar with Active Directory, the on-premises directory and authentication system that is available with Windows Server, <em>but exactly <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/active-directory-whatis\">what is Azure Active Directory<\/a>?<\/em><br><br>Azure Active Directory (Azure AD or AAD) is a multi-tenant cloud directory and <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/authentication-scenarios\">authentication <\/a>service. <br>Azure AD is the directory service that Office 365 (and Azure) leverages for account, groups, and roles.<br>It is also an Identity Provider (IPD) and supports federation (SAML, etc).  <br>Note: given how rapidly the cloud changes, elements of this post may become out of date soon after the original post date.<br><strong><br>Azure AD is highly available and globally deployed.<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p> Azure AD is deployed in over 30 datacenters around the world  leveraging  Azure Availability Zones where present. This number is  growing rapidly  as additional Azure Regions are deployed. <br><br> For durability, any piece of data written to Azure AD is replicated  to  at least 4 and up to 13 datacenters depending on your tenant   configuration. Within each data center, data is again replicated at least 9 times for durability but also to scale out capacity to serve authentication load. To illustrate\u2014this means that at any point in time, there are at least 36 copies of your directory data available within our service in our smallest region. For durability, writes to Azure AD are not completed until a successful commit to an out of region datacenter. <br><br> This approach gives us both durability of the data and massive   redundancy\u2014multiple network paths and datacenters can serve any given   authorization request, and the system automatically and intelligently   retries and routes around failures both inside a datacenter and across   datacenters. <br><br> To validate this, we regularly exercise fault injection and validate the system\u2019s resiliency to failure of the system components Azure AD is  built on. This extends all the way to taking out entire datacenters on a  regular basis to confirm the system can tolerate the loss of a  datacenter with zero customer impact. <br>&#8230;<br> Azure AD is already a massive system running on over 300,000 CPU Cores  and able to rely on the massive scalability of the Azure Cloud to  dynamically and rapidly scale up to meet any demand. This can include  both natural increases in traffic, such as a 9AM peak in authentications  in a given region, but also huge surges in new traffic served by our  Azure AD B2C which powers some of the world\u2019s largest events and frequently sees rushes of millions of new users. <br>&#8230;<br> To support the health checks that gate safe deployment and give our  engineering team insight into the health of the systems, Azure AD emits a  massive amount of internal telemetry, metrics, and signals used to  monitor the health of our systems. At our scale, this is over 11  PetaBytes a week of signals that feed our automated health monitoring systems.  <\/p><cite><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/advancing-azure-active-directory-availability\/\">https:\/\/azure.microsoft.com\/en-us\/blog\/advancing-azure-active-directory-availability\/<\/a><\/cite><\/blockquote>\n\n\n\n<p><strong>Azure Active Directory is Not Cloud AD<\/strong><br>Azure Active Directory is not Active Directory hosted in the cloud. <br>There is no standard AD authentication methods such as NTLM or Kerberos; no LDAP; and no group policy (GPO), so Azure AD won&#8217;t work for traditional on-prem applications.<br><br>There are cloud hosted Active Directory environments that can be used to manage cloud workloads in Microsoft Azure (<a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/active-directory-ds\/\">Azure Active Directory Domain Services<\/a>), Amazon AWS (<a href=\"https:\/\/docs.aws.amazon.com\/directoryservice\/latest\/admin-guide\/directory_microsoft_ad.html\">Amazon Managed Microsoft AD<\/a>), and Google Cloud (<a href=\"https:\/\/cloud.google.com\/managed-microsoft-ad\/\">Managed Service for Microsoft Active Directory (AD)<\/a>). These are all hosted Microsoft Active Directory environments which have 2 Domain Controllers (or more) and the tenant admins do not receive Domain Admin rights to the hosted AD environment; only delegated access is provided which often includes the ability to create\/manage resources in a specific OU and specific GPOs.<br><br><em>Note: I don&#8217;t have room to include a comparison of these services here, but may write a future post if there&#8217;s interest (I did some research comparing Microsoft Azure vs Amazon AWS hosted AD service offerings in 2017).<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-1024x556.png\" alt=\"\" class=\"wp-image-4212\" width=\"768\" height=\"417\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-1024x556.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-300x163.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-768x417.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image.png 1426w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-6-1024x576.png\" alt=\"\" class=\"wp-image-4249\" width=\"768\" height=\"432\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-6-1024x576.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-6-300x169.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-6-768x432.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-6.png 1280w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p><strong>Primary Management Tools<\/strong><br>The tool that most AD administrators are familiar with is Active Directory Users and Computers aka ADUC (MMC tool). <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"745\" height=\"533\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-7.png\" alt=\"\" class=\"wp-image-4261\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-7.png 745w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-7-300x215.png 300w\" sizes=\"auto, (max-width: 745px) 100vw, 745px\" \/><\/figure>\n\n\n\n<p>Azure Active Directory administrators will primarily use the web console at https:\/\/portal.azure.com to administer the environment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"928\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8-1024x928.png\" alt=\"\" class=\"wp-image-4262\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8-1024x928.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8-300x272.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8-768x696.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8-1536x1392.png 1536w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-8.png 1987w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Admins that manage Active Directory on-prem and now Azure AD\/Office 365 will be using the on-prem MMC tools as well as the web admin portals (and various URLs associated with them).<br>There are PowerShell cmdlets available for managing Azure AD (similar to on-prem), though cloud features often move faster than the PowerShell tools are released, which means that using the cloud  admin portal should still be used, even when using PowerShell.<\/p>\n\n\n\n<p><strong>Interfacing with Azure Active Directory<\/strong><br>Since Azure AD doesn&#8217;t have LDAP, interfacing with AAD involves connecting via the Graph API (or PowerShell modules). I like PowerShell, so I use the PowerShell modules (or Portal websites) for management and reporting.<br><br>There are 2 primary PowerShell modules for interfacing with Azure AD: <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/?view=azureadps-1.0\">MSOnline <\/a>and <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/?view=azureadps-2.0\">AzureAD<\/a>. These can be installed through the PowerShell install feature:<br> <em> Install-Module -Name MSOnline -Force <\/em> <br> <em> Install-Module -Name AzureAD -Force<br><\/em><br>The AzureAD module may eventually replace the MSOnline PowerShell module, but there are features available in MSOnline that haven&#8217;t been ported to the Azure AD module (yet).  <\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Azure AD PowerShell Modules &amp; Cmdlets Comparison<\/strong><br><em>(module &amp; cmdlet data as of January 2020)<\/em><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Category<\/td><td>MSOnline<\/td><td>AzureAD<\/td><\/tr><tr><td>Administrative Unit<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoladministrativeunit?view=azureadps-1.0\">Get-MsolAdministrativeUnit<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Administrative Unit<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoladministrativeunitmember?view=azureadps-1.0\">Get-MsolAdministrativeUnitMember<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplication?view=azureadps-2.0\">Get-AzureADApplication<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationextensionproperty?view=azureadps-2.0\">Get-AzureADApplicationExtensionProperty<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationkeycredential?view=azureadps-2.0\">Get-AzureADApplicationKeyCredential<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationlogo?view=azureadps-2.0\">Get-AzureADApplicationLogo<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationowner?view=azureadps-2.0\">Get-AzureADApplicationOwner<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationpasswordcredential?view=azureadps-2.0\">Get-AzureADApplicationPasswordCredential<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyapplication?view=azureadps-2.0\">Get-AzureADApplicationProxyApplication<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyapplicationconnectorgroup?view=azureadps-2.0\">Get-AzureADApplicationProxyApplicationConnectorGroup<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyconnector?view=azureadps-2.0\">Get-AzureADApplicationProxyConnector<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyconnectorgroup?view=azureadps-2.0\">Get-AzureADApplicationProxyConnectorGroup<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyconnectorgroupmembers?view=azureadps-2.0\">Get-AzureADApplicationProxyConnectorGroupMember<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationproxyconnectormemberof?view=azureadps-2.0\">Get-AzureADApplicationProxyConnectorMemberOf<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadapplicationserviceendpoint?view=azureadps-2.0\">Get-AzureADApplicationServiceEndpoint<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td>Get-AzureADMSApplication&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td>Get-AzureADMSApplicationExtensionProperty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td>Get-AzureADMSApplicationOwner<\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddeletedapplication?view=azureadps-2.0\">Get-AzureADDeletedApplication<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceapproleassignedto?view=azureadps-2.0\">Get-AzureADServiceAppRoleAssignedTo<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceapproleassignment?view=azureadps-2.0\">Get-AzureADServiceAppRoleAssignment<\/a><\/td><\/tr><tr><td>Application<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadgroupapproleassignment?view=azureadps-2.0\">Get-AzureADGroupAppRoleAssignment<\/a><\/td><\/tr><tr><td>Authentication<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmsidentityprovider?view=azureadps-2.0-preview\">Get-AzureADMSIdentityProvider<\/a><\/td><\/tr><tr><td>Authentication<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmslifecyclepolicygroup?view=azureadps-2.0\">Get-AzureADMSLifecyclePolicyGroup<\/a><\/td><\/tr><tr><td>Authentication<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadoauth2permissiongrant?view=azureadps-2.0\">Get-AzureADOAuth2PermissionGrant<\/a><\/td><\/tr><tr><td>Contact<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolcontact?view=azureadps-1.0\">Get-MsolContact<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontact?view=azureadps-2.0\">Get-AzureADContact<\/a><\/td><\/tr><tr><td>Contact<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontactdirectreport?view=azureadps-2.0\">Get-AzureADContactDirectReport<\/a><\/td><\/tr><tr><td>Contact<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontactmanager?view=azureadps-2.0\">Get-AzureADContactManager<\/a><\/td><\/tr><tr><td>Contact<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontactmembership?view=azureadps-2.0\">Get-AzureADContactMembership<\/a><\/td><\/tr><tr><td>Contact<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontactthumbnailphoto?view=azureadps-2.0\">Get-AzureADContactThumbnailPhoto<\/a><\/td><\/tr><tr><td>Contract<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcontract?view=azureadps-2.0\">Get-AzureADContract<\/a><\/td><\/tr><tr><td>Device<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldevice?view=azureadps-1.0\">Get-MsolDevice<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddevice?view=azureadps-2.0\">Get-AzureADDevice<\/a><\/td><\/tr><tr><td>Device<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldeviceregistrationservicepolicy?view=azureadps-1.0\">Get-MsolDeviceRegistrationServicePolicy<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Device<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddeviceconfiguration?view=azureadps-2.0\">Get-AzureADDeviceConfiguration<\/a><\/td><\/tr><tr><td>Device<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddeviceregisteredowner?view=azureadps-2.0\">Get-AzureADDeviceRegisteredOwner<\/a><\/td><\/tr><tr><td>Device<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddeviceregistereduser?view=azureadps-2.0\">Get-AzureADDeviceRegisteredUser<\/a><\/td><\/tr><tr><td>DirSync<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldirsyncconfiguration?view=azureadps-1.0\">Get-MsolDirSyncConfiguration<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>DirSync<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldirsyncfeatures?view=azureadps-1.0\">Get-MsolDirSyncFeatures<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>DirSync<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldirsyncprovisioningerror?view=azureadps-1.0\">Get-MsolDirSyncProvisioningError<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>DirSync<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldirsyncprovisioningerror?view=azureadps-1.0\">Get-MsolHasObjectsWithDirSyncProvisioningErrors<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Domain<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldomain?view=azureadps-1.0\">Get-MsolDomain<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddomain?view=azureadps-2.0\">Get-AzureADDomain<\/a><\/td><\/tr><tr><td>Domain<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldomainverificationdns?view=azureadps-1.0\">Get-MsolDomainVerificationDns<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddomainverificationdnsrecord?view=azureadps-2.0\">Get-AzureADDomainVerificationDnsRecord<\/a><\/td><\/tr><tr><td>Domain<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoldomainfederationsettings?view=azureadps-1.0\">Get-MsolDomainFederationSettings<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Domain<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddomainnamereference?view=azureadps-2.0\">Get-AzureADDomainNameReference<\/a><\/td><\/tr><tr><td>Domain<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddomainserviceconfigurationrecord?view=azureadps-2.0\">Get-AzureADDomainServiceConfigurationRecord<\/a><\/td><\/tr><tr><td>Federation<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolfederationproperty?view=azureadps-1.0\">Get-MsolFederationProperty<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolgroup?view=azureadps-1.0\">Get-MsolGroup<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadgroup?view=azureadps-2.0\">Get-AzureADGroup<\/a><\/td><\/tr><tr><td>Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolgroup?view=azureadps-1.0\">Get-MsolGroup<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmsgroup?view=azureadps-2.0\">Get-AzureADMSGroup<\/a><\/td><\/tr><tr><td>Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolgroupmember?view=azureadps-1.0\">Get-MsolGroupMember<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadgroupmember?view=azureadps-2.0\">Get-AzureADGroupMember<\/a><\/td><\/tr><tr><td>Group<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadgroupowner?view=azureadps-2.0\">Get-AzureADGroupOwner<\/a><\/td><\/tr><tr><td>Group<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmsgrouplifecyclepolicy?view=azureadps-2.0\">Get-AzureADMSGroupLifecyclePolicy<\/a><\/td><\/tr><tr><td>Group<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmsdeletedgroup?view=azureadps-2.0-preview\">Get-AzureADMSDeletedGroup<\/a><\/td><\/tr><tr><td>License Subscription<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolsubscription?view=azureadps-1.0\">Get-MsolSubscription<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadsubscribedsku?view=azureadps-2.0\">Get-AzureADSubscribedSku<\/a><\/td><\/tr><tr><td>Object<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadmsdeleteddirectoryobject?view=azureadps-2.0-preview\">Get-AzureADMSDeletedDirectoryObject<\/a><\/td><\/tr><tr><td>Object<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadobjectbyobjectid?view=azureadps-2.0\">Get-AzureADObjectByObjectId<\/a><\/td><\/tr><tr><td>Partner<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolpartnercontract?view=azureadps-1.0\">Get-MsolPartnerContract<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Partner<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolpartnerinformation?view=azureadps-1.0\">Get-MsolPartnerInformation<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Password<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolpasswordpolicy?view=azureadps-1.0\">Get-MsolPasswordPolicy<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Role Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolrole?view=azureadps-1.0\">Get-MsolRole<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddirectoryrole?view=azureadps-2.0\">Get-AzureADDirectoryRole<\/a><\/td><\/tr><tr><td>Role Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolrolemember?view=azureadps-1.0\">Get-MsolRoleMember<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddirectoryrolemember?view=azureadps-2.0\">Get-AzureADDirectoryRoleMember<\/a><\/td><\/tr><tr><td>Role Group<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolscopedrolemember?view=azureadps-1.0\">Get-MsolScopedRoleMember<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Role Group<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaddirectoryroletemplate?view=azureadps-2.0\">Get-AzureADDirectoryRoleTemplate<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolserviceprincipal?view=azureadps-1.0\">Get-MsolServicePrincipal<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipal?view=azureadps-2.0\">Get-AzureADServicePrincipal<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolserviceprincipalcredential?view=azureadps-1.0\">Get-MsolServicePrincipalCredential<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalkeycredential?view=azureadps-2.0\">Get-AzureADServicePrincipalKeyCredential<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalcreatedobject?view=azureadps-2.0\">Get-AzureADServicePrincipalCreatedObject<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalmembership?view=azureadps-2.0\">Get-AzureADServicePrincipalMembership<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipaloauth2permissiongrant?view=azureadps-2.0\">Get-AzureADServicePrincipalOAuth2PermissionGrant<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalownedobject?view=azureadps-2.0\">Get-AzureADServicePrincipalOwnedObject<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalowner?view=azureadps-2.0\">Get-AzureADServicePrincipalOwner<\/a><\/td><\/tr><tr><td>Service Principal<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadserviceprincipalpasswordcredential?view=azureadps-2.0\">Get-AzureADServicePrincipalPasswordCredential<\/a><\/td><\/tr><tr><td>Session<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadcurrentsessioninfo?view=azureadps-2.0-preview\">Get-AzureADCurrentSessionInfo<\/a><\/td><\/tr><tr><td>Tenant<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolcompanyalloweddatalocation?view=azureadps-1.0\">Get-MsolCompanyAllowedDataLocation<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Tenant<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolcompanyinformation?view=azureadps-1.0\">Get-MsolCompanyInformation<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><tr><td>Tenant<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadtenantdetail?view=azureadps-2.0\">Get-AzureADTenantDetail<\/a><\/td><\/tr><tr><td>Tenant<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadtrustedcertificateauthority?view=azureadps-2.0\">Get-AzureADTrustedCertificateAuthority<\/a><\/td><\/tr><tr><td>Tenant<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-crosscloudverificationcode?view=azureadps-2.0-preview\">Get-CrossCloudVerificationCode<\/a><\/td><\/tr><tr><td>User<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoluser?view=azureadps-1.0\">Get-MsolUser<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduser?view=azureadps-2.0\">Get-AzureADUser<\/a><\/td><\/tr><tr><td>User<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoluserbystrongauthentication?view=azureadps-1.0\">Get-MsolUserByStrongAuthentication<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserapproleassignment?view=azureadps-2.0\">Get-AzureADUserAppRoleAssignment<\/a><\/td><\/tr><tr><td>User<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msoluserrole?view=azureadps-1.0\">Get-MsolUserRole<\/a><\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadusercreatedobject?view=azureadps-2.0\">Get-AzureADUserCreatedObject<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserdirectreport?view=azureadps-2.0\">Get-AzureADUserDirectReport<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserextension?view=azureadps-2.0\">Get-AzureADUserExtension<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadextensionproperty?view=azureadps-2.0\">Get-AzureADExtensionProperty<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserlicensedetail?view=azureadps-2.0\">Get-AzureADUserLicenseDetail<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadusermanager?view=azureadps-2.0\">Get-AzureADUserManager<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureadusermembership?view=azureadps-2.0\">Get-AzureADUserMembership<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduseroauth2permissiongrant?view=azureadps-2.0\">Get-AzureADUserOAuth2PermissionGrant<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserowneddevice?view=azureadps-2.0\">Get-AzureADUserOwnedDevice<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserownedobject?view=azureadps-2.0\">Get-AzureADUserOwnedObject<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserregistereddevice?view=azureadps-2.0\">Get-AzureADUserRegisteredDevice<\/a><\/td><\/tr><tr><td>User<\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/azuread\/get-azureaduserthumbnailphoto?view=azureadps-2.0\">Get-AzureADUserThumbnailPhoto<\/a><\/td><\/tr><tr><td>User<\/td><td><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/msonline\/get-msolaccountsku?view=azureadps-1.0\">Get-MsolAccountSku<\/a><\/td><td>&nbsp;&nbsp;&nbsp;&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In the table above, I categorize the cmdlets across the two Azure AD PowerShell module and attempt to link the ones that provide the same or similar capability. I am planning to post more on these cmdlets in the future.<\/p>\n\n\n\n<p>Unfortunately, it isn&#8217;t a simple matter to single sign-on (SSO) to these modules. A credential can be captured in PowerShell and reused across modules, but only if MFA isn&#8217;t enforced (which reduces account security).<br><br>The Microsoft Cloud environment originally only supported username and password authentication. This &#8220;legacy authentication&#8221; doesn&#8217;t include <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/authentication\/concept-mfa-howitworks\">Multi-Factor Authentication (&#8220;MFA&#8221;)<\/a>, so for security reasons, legacy authentication should be disabled (via <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/concept-fundamentals-security-defaults\">Security Defaults<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/conditional-access\/block-legacy-authentication\">Conditional Access<\/a>, etc).<br>The Azure Active Directory Authentication Library provides &#8220;modern authentication&#8221; which fully supports MFA (and <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/authentication\/concept-authentication-passwordless\">passwordless<\/a>!).<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"> <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/active-directory-authentication-libraries\">ADAL according to Microsoft:<\/a> <\/span><br><em>The Azure Active Directory Authentication Library (ADAL) v1.0 enables  application developers to authenticate users to cloud or on-premises  Active Directory (AD), and obtain tokens for securing API calls. ADAL  makes authentication easier for developers through features such as:<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>Configurable token cache that stores access tokens and refresh tokens<\/em><\/li><li><em>Automatic token refresh when an access token expires and a refresh token is available<\/em><\/li><li><em>Support for asynchronous method calls<\/em><\/li><\/ul>\n\n\n\n<p>There is an ADAL PowerShell Module (<em>Install-Module -Name adal.ps<\/em>) which provides some level of SSO across modules (that support it).<br>Once you have the ADAL module installed, run the following to load the ADAL token in the session:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$clientId = \"1b730954-1685-4b74-9bfd-dac224a7b894\" # Azure AD PowerShell\n     $redirectUri = [Uri]::new('urn:ietf:wg:oauth:2.0:oob')\n     $authority = \"https:\/\/login.windows.net\/common\/oauth2\/authorize\"\n     $resourceUrl = \"https:\/\/graph.windows.net\"\n\n <code>$ADALresponse = get-adaltoken -Resource $resourceUrl -ClientId $clientId -RedirectUri $redirectUri -Authority $authority -PromptBehavior:Always<\/code><\/pre>\n\n\n\n<p>Once the $ADALResponse variable is captured, you can leverage this token in the Azure AD modules:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ConnectAzureADInfo = connect-azuread -AadAccessToken $ADALresponse.AccessToken -AccountId $ADALresponse.UserInfo.DisplayableId\n\n$ConnectMsolInfo = connect-msolservice -AdGraphAccessToken $ADALresponse.AccessToken\n\n# Looks like the Microsoft Teams PowerShell module supports ADAL as well, though I added a new variable that includes the signed-in user UPN.\nConnect-MicrosoftTeams -AadAccessToken $ADALresponse -AccountId $AssessmentAccountUPN<\/pre>\n\n\n\n<p><br><strong>Access Rights to Azure Active Directory<\/strong><br>With Active Directory, just about everything can be viewed as a regular user. Azure AD users can view information about users and groups, but there are some limitations as to what is accessible. <br><br>In Azure AD, privileged groups are called &#8220;roles&#8221; (which are groups) in order to identify special access. There are several of these <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-assign-admin-roles\">admin roles<\/a> in Office 365 which provide admin-level rights to all of Office 365 or specific parts of it. (<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/active-directory-users-assign-role-azure-portal\">Assigning Roles<\/a>)<br><br>Many organizations have a reporting account in the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-assign-admin-roles#company-administrator-permissions\">Global Administrator<\/a> (aka Tenant Administrator) role which is effectively Enterprise Admin, Domain Admin, and Schema Admin wrapped up into a single group. Global Admin has full control to Azure AD and all Office 365 services. This is why many organizations have more than 5 Global Admins (Microsoft&#8217;s maximum recommended number). Only cloud accounts should be added to roles so they can leverage Azure MFA (&amp; passwordless) as well as the role membership controlled by PIM.<br>Also strongly recommended is creating a<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-emergency-access\"> &#8220;break-glass&#8221; administrator account (or two) <\/a>to ensure continued privileged access to the tenant.<br>Microsoft published a document on <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-admin-roles-secure\">how to secure privileged access<\/a>.<br><br><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/privileged-identity-management\/pim-configure\">Privileged Identity Management (PIM)<\/a> is strongly recommended for controlling role membership and requires Azure AD Premium 2 (P2) licenses for each account that will use PIM. PIM provides just in time access to the admin role with the required rights. When an admin needs admin rights, they can request &amp; gain access through PIM (which can be sent for approval or auto-approved). Microsoft recommends all accounts in roles are managed by PIM (and have AAD P2 licenses).<br>There is also a Powershell module for PIM which can be installed:<br><em>Install-Module -Name Microsoft.Azure.ActiveDirectory.PIM.PSModule<\/em><br><br>In Fall 2019, Microsoft added a new role called &#8220;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-assign-admin-roles#global-reader-permissions\">Global Reader<\/a>&#8221; which has read-only\/view-only rights to all Azure AD\/Office 365 services that Global Admin can see (with some exceptions since Microsoft is still rolling out Global Reader read-only capability to all Office 365 services). Membership in Global Reader should be provided to the security team or auditors that require view-only access to the Microsoft Cloud (Azure AD &amp; Office 365) environment.<br> <\/p>\n\n\n\n<p><strong>Attacking Azure Active Directory<\/strong><br>Office 365 services are accessible from the internet (by default, use <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/conditional-access\/overview\">Conditional Access<\/a> to restrict access) which makes them attractive to attackers. Attackers leverage several attack methods against Azure AD &amp; Office 365.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Account Enumeration<\/span><br>With old school Active Directory, any Active Directory user can enumerate all user accounts &amp; admin group membership with network access to a Domain Controller.<br>Azure Active Directory users can enumerate all user accounts &amp; admin group  membership with access to Office 365 services (the internet by default). User enumeration often possible without an account using O365creeper which attempts to authenticate to O365 using a list of email addresses. Based on the response code, the tool determines if the email address is a valid user account (or not).<br><br><span style=\"text-decoration: underline;\">Azure AD Enumeration Tools<\/span> <br><a href=\"https:\/\/github.com\/LMGsec\/o365creeper\">O365 Creeper &#8211; Office 365 Authentication Page<\/a> (Python) [Account Discovery]<br><a href=\"https:\/\/github.com\/busterb\/msmailprobe\">OWA <\/a>(Golang)<br><a href=\"https:\/\/bitbucket.org\/grimhacker\/office365userenum\/src\">ActiveSync <\/a>(Python)<br><a href=\"https:\/\/github.com\/nyxgeek\/o365recon\">MSOnline\/AzureAD PowerShell Module<\/a> (PowerShell) <\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Password Spraying <\/span><br> A common method attackers leverage as well as many penetration testers  and Red Teamers is called &#8220;password spraying&#8221;. Password spraying is interesting because it\u2019s automated password guessing. This automated  password guessing against all users typically avoids account lockout  since the logon attempts with a specific password are performed against  against every user and not one specific one which is what account  lockout was designed to defeat. The attacker starts with a list list of  passwords they&#8217;re going to try which starts with the most likely passwords (&#8220;Fall2017&#8221;, &#8220;Winter2018&#8221;, etc). <br><br>When password spraying begins, we start with the first password in the list. That first password is used in an attempt to authenticate as every user (or a subset). This one password is attempted against each user and once all users have been tested with that password, we move  on to the next one. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"644\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2-1024x644.png\" alt=\"\" class=\"wp-image-4238\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2-1024x644.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2-300x189.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2-768x483.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2-1536x966.png 1536w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-2.png 1620w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"476\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3-1024x476.png\" alt=\"\" class=\"wp-image-4240\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3-1024x476.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3-300x139.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3-768x357.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3-1536x714.png 1536w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-3.png 1644w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Password Spraying is relatively trivial to perform and is extremely effective.&nbsp;&nbsp;<br>We have worked with many organizations with accounts that were compromised by password spraying their cloud environment. Many customers that are Federated don\u2019t realize it\u2019s their job to look for this, not the cloud&#8217;s. There is a real risk beyond the cloud with password spraying. If the same password is used for the cloud account and on-prem and there is no MFA configured, it\u2019s possible that an attacker could password spray the   cloud account and then gain access to the corporate network. This is not a theoretical or hypothetical scenario and underscores the importance of MFA.&nbsp;  <\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Office 365 Password Spraying Tools <\/span><br><a href=\"https:\/\/github.com\/sensepost\/ruler\/wiki\/Brute-Force\">Ruler <\/a>(Exchange) [Golang]<br><a href=\"https:\/\/github.com\/byt3bl33d3r\/SprayingToolkit\">SprayingToolkit <\/a>(Lync\/Skype for Business\/OWA) [Python]<br><a href=\"https:\/\/github.com\/mdsecresearch\/LyncSniper\">LyncSniper <\/a>(Lync\/Skype for Business) [PowerShell]<br><a href=\"https:\/\/github.com\/dafthack\/MailSniper\">MailSniper <\/a>(OWA\/EWS) [PowerShell]<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Office 365 Password Spraying Mitigation<\/span><br>Disable Legacy authentication by enabling &#8220;<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/concept-fundamentals-security-defaults\">Security Defaults<\/a>&#8221; or configuring a custom <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/conditional-access\/overview\">Conditional Access<\/a>  policy. Also requiring MFA for all users is strongly recommended.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Office 365 Password Spraying Detection<\/span><br>Assuming password spraying targets Office 365 services and federation is not configured (ADFS, Okta, etc), then detection can be performed by referencing the Azure AD sign-in logs. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"452\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4-1024x452.png\" alt=\"\" class=\"wp-image-4242\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4-1024x452.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4-300x132.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4-768x339.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4-1536x678.png 1536w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-4.png 1590w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"453\" src=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5-1024x453.png\" alt=\"\" class=\"wp-image-4243\" srcset=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5-1024x453.png 1024w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5-300x133.png 300w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5-768x340.png 768w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5-1536x680.png 1536w, https:\/\/adsecurity.org\/wp-content\/uploads\/2020\/01\/image-5.png 1654w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Detect by correlating multiple events for the same user within a timeframe with the sign-in error code &#8220;50126&#8221; and the Client app is &#8220;Other clients; Older Office clients&#8221; (which means legacy authentication was performed). <br><\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Account token theft &amp; reuse&nbsp;<\/span><br>Since cloud authentication typically results in a token stored in the authenticated app or web browser, this is the proof of authentication and could be reused. The web browser typically stores this auth token as a cookie. If this data is stolen, an attacker could leverage this to spoof access and configure persistence for continued access.&nbsp;<\/p>\n\n\n\n<p><strong>Azure AD Reviews<\/strong><br>Microsoft&#8217;s Azure AD GitHub includes PowerShell code for reviewing Azure AD configuration (<a href=\"https:\/\/github.com\/AzureAD\/AzureADAssessment\">https:\/\/github.com\/AzureAD\/AzureADAssessment<\/a>)<br><br>Trimarc also has a new service offering called the <a href=\"https:\/\/www.trimarcsecurity.com\/microsoftcloud-security-assessment\">Microsoft Cloud Security Assessment (MCSA)<\/a> which is similar to the on-prem <a href=\"https:\/\/www.trimarcsecurity.com\/ad-security-assessment\">Active Directory Security Assessment<\/a> but focused on Azure AD &amp; Office 365.<br><\/p>\n\n\n\n<p><strong>Additional Office 365 Service PowerShell Modules<\/strong><br><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/exchange\/exchange-online\/exchange-online-powershell-v2\/exchange-online-powershell-v2?view=exchange-ps\">Exchange Online Module<\/a><br><em>Install-Module -Name ExchangeOnlineManagement<\/em><br><br><a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/sharepoint\/sharepoint-online\/connect-sharepoint-online?view=sharepoint-ps\">Microsoft SharePoint<\/a><br><em>Install-Module -Name Microsoft.Online.SharePoint.PowerShell<\/em><br><br><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoftteams\/teams-powershell-overview\">Microsoft Teams<\/a><br><em>Install-Module -Name MicrosoftTeams<\/em><br><br><a href=\"https:\/\/docs.microsoft.com\/en-us\/office365\/enterprise\/powershell\/manage-skype-for-business-online-with-office-365-powershell\">Microsoft Skype for Business Online<\/a><br><br><a href=\"https:\/\/github.com\/microsoftgraph\/powershell-intune-samples\">Microsoft InTune <\/a>  <br><em>Install-Module -Name Microsoft.Graph.Intune -Force<\/em>  <br>(Requires an admin to provide Admin Consent:  <em>Connect-MSGraph -AdminConsent<\/em>)<br><\/p>\n\n\n\n<p> <strong>References:<\/strong>  <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/active-directory-whatis\">What is Azure Active Directory<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/whats-new\">What&#8217;s New in Azure Active Directory?<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/fundamentals\/active-directory-deployment-checklist-p2\">Azure Active Directory Feature Deployment Guide<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/conditional-access\/overview\">Conditional Access<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/privileged-identity-management\/pim-getting-started\">Start Using Privileged Identity Manager (PIM)<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/authentication\/concept-mfa-howitworks\">Azure Multi-Factor Authentication (MFA)<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/identity-protection\/overview-identity-protection\">Azure AD Identity Protection<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/authentication\/concept-sspr-howitworks\">Azure AD Self Service Password Reset (SSPR)<\/a> <\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/users-groups-roles\/directory-admin-roles-secure\">Securing privileged access for hybrid and cloud deployments in Azure AD<\/a><\/li><li><a href=\"https:\/\/www.blackhat.com\/us-19\/briefings\/schedule\/#attacking-and-defending-the-microsoft-cloud-office-365--azure-ad-14553\">Black Hat USA 2019 \u2013 \u201cAttacking and Defending the Microsoft Cloud (Office 365 &amp; Azure AD)\u201d<\/a> <br> <a href=\"https:\/\/adsecurity.org\/wp-content\/uploads\/2019\/08\/2019-BlackHat-US-Metcalf-Morowczynski-AttackingAndDefendingTheMicrosoftCloud.pdf\">Slides (PDF)<\/a> <br> <a href=\"https:\/\/www.youtube.com\/watch?v=SG2ibjuzRJM&amp;feature=youtu.be&amp;list=PLH15HpR5qRsWrfkjwFSI256x1u2Zy49VI\">Presentation Video (YouTube)<\/a><\/li><li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/authentication\/concept-password-ban-bad\">Azure AD Password Protection (for on-prem Active Directory)<\/a><\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many are familiar with Active Directory, the on-premises directory and authentication system that is available with Windows Server, but exactly what is Azure Active Directory? Azure Active Directory (Azure AD or AAD) is a multi-tenant cloud directory and authentication service. Azure AD is the directory service that Office 365 (and Azure) leverages for account, groups, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/adsecurity.org\/?p=4211\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[1376,1401,20,1395,1013,1389,1390,1379,1378,1393,491,136,1397,1388,1392,1385,1402,1382,1381,135,1377,1387,1386,1394,1399,1374,1398,1375,1396,1400,1024,1380,1391,1383,1384],"class_list":["post-4211","post","type-post","status-publish","format-standard","hentry","category-technical-reference","tag-aad","tag-accounttokentheft","tag-activedirectory","tag-activesync","tag-ad","tag-adal","tag-adalpowershell","tag-attackingmicrosoftcloud","tag-attackingoffice365","tag-azure-ad-account-enumeration","tag-azureactivedirectory","tag-azuread","tag-azureadpasswordspray","tag-azureadpowershellmodule","tag-azurepim","tag-cloudad","tag-exchangeonlinemodule","tag-globaladmin","tag-globalreader","tag-microsoftcloud","tag-microsoftcloudsecurity","tag-msonline","tag-o365","tag-o365creeper","tag-o365passwordspray","tag-office365","tag-office365passwordspray","tag-office365security","tag-owa","tag-passwordspraydetection","tag-passwordspraying","tag-pim","tag-privilegedidentitymanagement","tag-whatisazureactivedirectory","tag-whatisazuread","item-wrap"],"_links":{"self":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/4211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4211"}],"version-history":[{"count":47,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/4211\/revisions"}],"predecessor-version":[{"id":4270,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/4211\/revisions\/4270"}],"wp:attachment":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}