This article is an attempt at discovering what the minimum steps are to get the Conditional Access feature which checks for Domain Join status for both Windows 10 and Windows 7 operating systems.
Conditional Access is a feature of the “Azure AD Premium P1 License” which can be purchased ala carte for $6/user/month, or as part of the “Enterprise Mobility + Security license” for $8.75/user/month, or the new Microsoft 365 SKU announced at the 2017 Inspire conference.
This is what the feature looks like when configuring a Conditional Access Policy in the Azure Portal to only permit domain joined devices:
For more information about Conditional Access, read about it here.
I had the following questions:
- What does the conditional policy mean by “Domain Join” – is it on-premises or is it Azure AD Domain Join, both, or something else? (Answer: on-prem domain join with an account that has been synced by Azure AD Connect to the cloud… with a software deployment required for Windows 7, and a GPO required for Windows 10).
- Is it necessary to deploy the Workplace Join v2.1 client to Windows 7 Machines? (Answer: Yes)
- Does Azure AD Connect require configuration, and if so, what is the minimum version of Azure AD Connect required? (Yes, you must create a service connection point in Active Directory per this article).
- What role does Azure AD Seamless Single Sign-On Play (also referred to as “Desktop SSO” in the Azure AD Connect documentation) Answer: (It provides a similar SSO experience to ADFS, but only when connected to the corporate network).
- Is ADFS required? (Answer: No)
- Is there any configuration necessary in Azure AD? (Answer: Not unless you changed the default settings)
- Is it necessary to deploy a Group Policy change? If so, what are those changes? (Answer: For Windows 10, Yes, see below)
- Is it necessary to create any DNS records? (Answer: Yes, see below)
Domain Join vs Azure AD Domain Join vs Azure AD Registration
If you configure a Conditional Access Policy and select the “require domain joined device” checkbox, what is it checking?
To find out, I created 6 virtual machines to see exactly what works and what does not work.
|Computer Name||Operating System||Configuration||Test Results||Notes|
|Win10DomainJoin||Windows 10.0.15063 (Creators)||
|Win10DJandReg||Windows 10.0.15063 (Creators)||
|Win10DJandAADJ||Windows 10.0.15063 (Creators)||
|Win10AADJoined||Windows 10.0.15063 (Creators)||
||Fail – Got a block page (see block page example below)||Wasn’t entirely expecting this to work since the screen tip that is in-band of the configuration says that this checkbox does *not* apply to Azure AD joined machines.
|Win7DomainJoin||Windows 7 SP1||
||Fail – Got a block page (see block page example below)||Wasn’t expecting this to work – just testing to create a baseline before the Workplace Join client was installed. With no ADFS in the environment – just Azure AD Connect with Desktop SSO and Password Hash Sync.|
|Win7DJwithWPJ||Windows 7 SP1||
||SUCCESS||I was starting to lose hope after all these failed tests, but we now have a successful test!
The common denominator for the successful test was the DeviceTrustLevel changed to “Managed”
Block Page Example
This is the end-user example of what it looks like when you try to open an application protected by a Conditional Access Policy that requires Domain Join.
According to the documentation, is necessary to register the following DNS CNAME record in both internal and external DNS (if using split-zone / split-brain DNS):
|DNS Entry||Type||DNS Value (Address)|
Workplace Join v2.1
For Windows 7 and Windows 8.1 devices, the documentation states that it is necessary to deploy the Workplace Join client (MSI Package) from here. This is not required for Windows 10 systems, which can register to Azure AD via group policy, although in my lab that does not appear to be working, as that does not produce any records when I run get-msoldevice. Perhaps it requires ADFS for Windows 10 machines to work with Domain Join conditional access.
Workplace join Version 2.1 (Released June 2017) added support for Azure Active Directory Seamless Single Sign On (https://aka.ms/hybrid/sso).
Ready for some kludge? The installer creates a scheduled task on the system that runs in the user’s context. The task is triggered when the user signs in to Windows. The task silently registers the device with Azure AD with the user credentials after authenticating using Integrated Windows Authentication. To see the scheduled task, in the device, go to Microsoft > Workplace Join, and then go to the Task Scheduler library.
The two main benefits of this tool in my opinion is that it registers a Windows 7 machine in Azure AD, and, the version 2.1 client makes it so that you don’t have to use ADFS (simplifying the configuration).
Azure AD Seamless Single Sign-On
Azure Active Directory Seamless Single Sign-On (Azure AD Seamless SSO) automatically signs users in when they are on their corporate devices connected to your corporate network. When enabled, users don’t need to type in their passwords to sign in to Azure AD, and usually, even type in their usernames. This feature provides your users easy access to your cloud-based applications without needing any additional on-premises components.
If you have ADFS, you do not need this feature as ADFS already provides “seamless SSO” (assuming you also deployed the ADFS STS web page to your Local Intranet zone in Internet Explorer).
*Note: The ‘Edge’ web browser is not yet supported. Currently IE, Chrome and Firefox are supported. Firefox requires custom configuration to make it work.
To deploy seamless SSO, you turn it on in Azure AD Connect, then you deploy it through Group Policy.
Azure AD Connect
You must be using version 1.1.484.0 or later of Azure AD Connect.
If you already have an installation of Azure AD Connect, choose “Change user sign-in page” on Azure AD Connect and click “Next”. Then check the “Enable single sign on” option
Completing that step will create a new computer object in Active Directory “AZUREADSSOACC” – if this object is accidentally deleted, users can still logon, but it will just be the standard logon just like prior to seamless SSO being enabled (so it ‘fails open’ so to speak). For more information see the technical deep dive here.
You can add the Azure AD device authentication end-point to the local Intranet zones to avoid certificate prompts when authenticating the device. This works for both IE and Chrome which both share the same setting. For other browsers see the references section.
To roll this out in a group policy object, here are the steps:
- Open the Group Policy Management tool on a domain controller, ex: start > run > gpmc.msc
- Edit the Group Policy that is applied to some or all your users.
Navigate to User Configuration\Administrative Templates\Windows Components\Internet Explorer\Internet Control Panel\Security Page and select Site to Zone Assignment List
Enable the policy, and enter the following values (1 indicates Intranet zone) in the dialog box.
Note: One of the references only listed the first URL, whereas another reference listed the bottom two. Since the documentation was not consistent, I’m including all three to be safe.
ADFS is not required as long as you deploy the Workplace Join v2.1 client to your Windows 7 systems.
Azure AD Configuration
By default, Azure AD enables users to register devices. So unless someone in your organization changed this setting, you should not have to change this. This is found in http://portal.azure.com then find Azure Active Directory > Users and groups > Device settings. The policy “Users may register their devices with Azure AD” must be set to “All” (which is the default setting).
All domain-joined devices running Windows 10 Anniversary Update and Windows Server 2016 automatically register with Azure AD at device restart or user sign-in. However, Windows 10 November 2015 Update automatically registers with Azure AD only if the rollout Group Policy object is set. So the best thing to do is configure a Group Policy object to control the rollout of automatic registration of Windows 10 and Windows Server 2016 domain-joined computers.
Go to Computer Configuration > Policies > Administrative Templates > Windows Components > Device Registration. Right-click Register domain-joined computers as devices, and then select Edit. Select Enabled, and then select Apply.
- Older GPMC Consoles may see: Computer Configuration > Policies > Administrative Templates > Windows Components > Workplace Join > Automatically workplace join client computers. Select Enabled, and then select Apply.
The output of this cmdlet shows devices registered in Azure AD. To get all devices, use the -All parameter, and then filter them using the deviceTrustType property. Domain joined devices have a value of Domain Joined. In my testing, the only combination that seemed to work with conditional access is when the DeviceTrustType was Domain Joined, and the DeviceTrustLevel was Managed.
To test the scenario where the user enters only the username, but not the password:
Sign into https://myapps.microsoft.com/ in a new private browser session.
To test the scenario where the user doesn’t have to enter the username or the password:
- Sign into https://myapps.microsoft.com/contoso.onmicrosoft.com in a new private browser session. Replace “contoso” with your tenant’s name.
Or sign into https://myapps.microsoft.com/contoso.com in a new private browser session. Replace “contoso.com” with a verified domain (not a federated domain) in your tenant.
When configuring your first conditional access policy, apply it to a test user, and apply it for only one cloud app. This prevents you from accidentally locking yourself or others out. See best practices reference below for more good ideas.
- Check to make sure the computer account is syncing to the cloud by running get-msoldevice. If it does not show up there, then make sure the OU or container containing the computer objects is being synced. If it shows up there, it must have DeviceTrustType = ‘Domain Joined’ and DeviceTrustLevel = ‘Managed’
- Check to see if the computer object contains a value in the userCertificate attribute. If not, this means that the computer is unable to read the value of the SCP object in Active Directory. Check to make sure that the Authenticated Users group is not missing from the “Device Registration Configuration” object. To see if it can query the SCP, run this command:
$config = [ADSI] “LDAP://CN=Device Registration Configuration,CN=Services,CN=Configuration,DC=YourDomain,DC=com”;
- Run the dsregcmd /status and make sure ‘AzureAdJoined’ is Yes and ‘IsUserAzureAD’ is Yes
Under User State, verify that WamDefaultSet is Yes, WamDefaultAuthority is organizations, WamDefaultId is https://login.microsoft.com, AzureAdPrt is Yes, and WamDefaultGUID contains a value.
- Enable Debug and Analytic logs in Event Viewer. Click the View menu. Select Show Analytic and Debug Logs to make these logs visible. Enable logs under Applications and Services Logs > Microsoft > Windows > User Device Registration, and then export the logs for Admin and Analytic folders about five minutes after you have rebooted (or signed-out/in)
- Check the troubleshooting article https://docs.microsoft.com/en-us/azure/active-directory/active-directory-device-registration-troubleshoot-windows