Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic device registration happens despite GPO control. Disabled doesn't work #31078

Closed
TechTrooper opened this issue May 13, 2019 · 42 comments

Comments

@TechTrooper
Copy link

TechTrooper commented May 13, 2019

At the moment GPO "Windows Components/Device Registration/Register domain joined computers as devices" has absolutely no effect. Disabled setting doesn't block Windows10 Azure AD Hybrid Join.

Once you install ServiceConnectionPoint for Azure AD Hybrid Join, every single Windows 10 machine in forest will perform AAD Hybrid Join. Doesn't matter if OU's are synced or not in AAD Connect.

Also happens in child or tree domains, they don't have to be even verified to AAD.
W10 devices get enrolled as AAD Hybrid Joined anyway.

Tested on Server 2016 with federated root domain and Windows 10 1803+1809 client VMs.

This can be huge issue for several of our customers and can delay purchasing M365 licenses until fixed.
For many organizations it is not a realistic possibility to join every W10 device in a forest to AAD

Here's comments from someone else who noticed same problem and apparently Microsoft support has replied that it's a known issue..
https://community.spiceworks.com/topic/2203360-devices-hybrid-azure-ad-joining-despite-gpo-applied-to-block-it


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@SadiqhAhmed-MSFT
Copy link
Contributor

@TechTrooper Thanks for the question! We will investigate this issue and get back to you soon.

@ManojReddy-MSFT
Copy link
Member

@TechTrooper can you please confirm the value of the "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin" registry key on the machines where you applied the Group policy ?

@TechTrooper
Copy link
Author

TechTrooper commented May 13, 2019

@TechTrooper can you please confirm the value of the "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WorkplaceJoin" registry key on the machines where you applied the Group policy ?

autoWorkplaceJoin value is 0 with the GPO: "Register domain joined computers as devices." set to Disabled
Here's the device state before setting up SCP for Azure AD Hybrid Join.
image

Here's the device state after setting up SCP for Azure AD Hybrid Join. GPO to disable registration is still applied and registry key exists, but it's ineffective. This can be disastrous for organizations expecting to perform limited registration.
image

@ManojReddy-MSFT
Copy link
Member

ManojReddy-MSFT commented May 15, 2019

@TechTrooper I have reached out to the Product group regarding this and they are working on fixing this in the next update.

Currently the suggested workaround for this to

  1. Delete the SCP
  2. Create a GPO to push the below registry keys only to the targeted devices.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CDJ\AAD]
"TenantId"="" Value type as “REG_SZ”
"TenantName"="" Value type as “REG_SZ”

This registry will help the device identify which tenant to target for the device registration.

I understand this is not the ideal solution, the product team is working on this and the document will be updated with the changes as well.

Hope this helps.

@ManojReddy-MSFT
Copy link
Member

@TechTrooper We have not heard from you in a while.We will now proceed to close this thread. If you have further questions, please tag me in the comments and I will gladly continue the conversation.

Copy link

@ManojReddy-MSFT,
We plan deployment of AAD Hybrid join and will use Federated setup, anything to worry based on this issue?
I did test using "managed domain + sso" and that worked fine in test farm.

Copy link

Hello,
Today opened a case with MS Pro Support and they confirm there is on-going issue with this "control" and without any ETA available...

Copy link

@ManojReddy-MSFT,
Just a question, if we will deploy Federated domain procedure but select only "down-level" via AAD Connect configuration, then this issue that people have, shouldn't apply to such setup right?

Copy link

We've just fallen foul of this issue, why has this been feedback been closed without updating the documentation to alert people the GPO control doesn't work?!

@ManojReddy-MSFT
Copy link
Member

@lightupdifire Generally Device registration task runs on every Windows 10 device automatically and having the GPO described int he doc will prevent his task from running.

In a federated scenario, when you configure AAD HJ through AD connect, ADFS rules are created and updated by AAD Connect, so if the rules are created correctly then the device will be joined to Azure AD. I am not sure what you mean by "select only down-level via AAD Connect", can you post a screenshot of the setting?

@benzini00 I am sorry for the inconvinience caused by this. I was informed that the product team is making the appropriate changes and hence I clsoed the issue. I followed up with the team today and will provide an update based on that.

@lightupdifire
Copy link

@ManojReddy-MSFT
Sure, we use ADFS and we want to deploy only "down-level", the 2nd option in AD Connect:
image

Question is, if using this 2nd option only, any similar issue like this case we could face?

@ManojReddy-MSFT
Copy link
Member

@lightupdifire The ADFS claim rules required will be created when you select either of the options. So, your Windows 10 devices also will get registered if you have any in your environment.

You would have to follow the steps mentioned in this doc and clear the SCP and use a GPO to populate the required registry keys.

@benzini00 The article has been updated with the information regarding SCP. let me know if you would like us to include any other details.

@lightupdifire
Copy link

@ManojReddy-MSFT,
Update of this article makes it more complex to understand what should be done, we don't want to enable automatic registration at all, only 2x servers should be allowed from 300+. What should we do?

What should be done to Disable automatic registration for Windows current devices for Managed domain?
What should be done to Disable automatic registration for Down-level devices for Managed domain?

What should be done to Disable automatic registration for Windows current devices for Federated domain?
What should be done to Disable automatic registration for Down-level devices for Federated domain?

Regards
<<
If you are using AD FS, you first need to configure client-side SCP using the instructions mentioned above but linking the GPO to your AD FS servers. This configuration is needed for AD FS to establish the source for device identities as Azure AD.>>
So only to ADFS and not to OU containing domain-joined computers?

Regards:
<<
b. Uncheck “Automatically remove unused devices” under Services > Device Registration > Properties
Where and why?

Regards:
<<
Note
Ensure default configuration remains unchanged for “Register domain-joined computers as devices” GPO set to
“Not Configured” and “Automatically register new Windows 10 domain joined devices with Azure Active Directory” set to “Yes” when using Configuration Manager.

And if not using Configuration Manager?

Just get really confused what should I do now to STOP automatic registration for any deployment scenario I choose.. And if I choose Managed domain or Federated domain, what exactly should be done, is it possible describe step by step and not like "look above" and "look below"?

Old article was more clear in terms of document setup, reading that could better understand like to stop all devices auto-register i need: 1-2-3

Now is like only giving option what to enable to do automatic registration, but not really explaining what to do to stop it...

Copy link
Contributor

@lightupdifire Here is all that you need to do:

  1. Make sure SCP entry is cleared from AD
  2. Configure SCP on the client (in this case your 2x servers) using the client-side registry option mentioned above
  3. If you are using AD FS, configure SCP on the AD FS itself using client-side registry option mentioned above

@lightupdifire
Copy link

@SanDeo-MSFT

So if we have:

  • On-premise domain;
  • Azure AD domain;
  • In between AD Connect & ADFS & WAP etc.
  • ~10x Windows 10 on-premise domain joined devices
  • ~50x Windows 2016+ on-premise domain joined devices (running DC, ADFS, WAP etc.)
  • ~240 Windows 2012 R2 and lower on-premise domain joined devices

Our plan is to use only "Down-level" solution now.

Our action would be:

  1. Make sure SCP entry is cleared from AD
  2. Configure SCP on the AD FS itself using client-side registry option mentioned above
  3. Run AD Connect and enable "down-level"
  4. Deploy Microsoft Workplace Join for non-Windows 10 computers

All those steps would be correct?
What will happen with "10x Windows 10" and with "50x Windows 2016"? they will not do "auto-register"?
Which exact action is stopping auto register, the "SCP clear"?

@ManojReddy-MSFT
Copy link
Member

@lightupdifire You would also need to create the SCP on the client using client-side registry option.

Windows 10 and Windows 2016 will not be auto-registered. Yes, the task which is running on these devices will look for SCP and as it is cleared, auto-register will not succeed.

@ManojReddy-MSFT
Copy link
Member

@lightupdifire We have not heard from you in a while. We will now proceed to close this thread. If you have further questions, please tag me in the comments and I will gladly continue the conversation.

Copy link

@ManojReddy-MSFT
Can you tell what the status is regarding the option to block automatic device registration?
We have tested with the SCP GPO and want to extend by configuring AD-Connect and ADFS. However we don't want all our W10 devices and Servers end up as Hybrid AD Joined devices. I see the following options:

[Option1]
We might control this by disable syncing specific W10 and Server OU's from AD-Connect. (Q: Are these devices removed from Azure AD then?)

[Option2]
Final goal is to set-up Co-Management. So we extend the SCP GPO to additional machines and configure Co-Management also, so they end up being brought under MDM control as well.

@lightupdifire
Copy link

@ManojReddy-MSFT
I'm back from short holiday :)

2 weeks ago I did open a ProSupport ticket via Azure and they confirm to me, that Product team confirms following issue:

  1. If we select during AD-Connect configuration wizard that we want to setup only "down-level" devices
  2. "Current version" devices will be affected and will start AADHJ

So for us will be important to block any "Current version" devices, because "Down level" devices require an agent installation at least.

Can you please advise, what will be best roll-back plan in scenario:

  1. We follow all steps from this article
  2. We run ADConnect and enable down-level
  3. For some magic reason "Current devices" start auto AADHJ

How to make those devices that do auto AADHJ to be just only on-premise domain joined as they were before and stop auto process?

@ManojReddy-MSFT
Copy link
Member

@nielsvdGH Removing the SCP and pushing the SCP GPO only to the devices that need to be registered to Azure is the recommended solution.

Removing the devices from sync scope will work with a managed domain. It will not work when you federate the domain. In federated scenarios, device authentication happens at the ADFS level and does not need synchronization.

@lightupdifire Yes, all versions will be affected when you enable device registration irrespective of the AD Connect setting.

Removing the SCP is the most important thing, as the automatic device registration task will look for it and when it does not find the SCP, the device will not be able to join. Once the SCP GPO is pushed, the registry key will provide the details required and the process will continue.

In a scenario, where you have windows 10 devices registered to Azure and you want to remove them, you need to do the following:

  1. Delete the device from Azure AD.
  2. Open CMD prompt as an admin and run the following command "dsregcmd /leave". This will manually unjoin the device.
  3. Make sure the SCP GPO is not applying to the device or else a restart will trigger the device registration task again.

Hope this clarifies things.

@lightupdifire
Copy link

@ManojReddy-MSFT
So actually if we don't have those entries in step "Clear the Service Connection Point (SCP) entry from Active Directory (AD) if it exists"
The values of azureADId and azureADName,
Then all should be fine? But is it possible that this value will be populated after we run ADConnect configuration wizzard?

Just checked production domain and can't find "azureADId and azureADName"
image

@ManojReddy-MSFT
Copy link
Member

@lightupdifire
Yes, If that value does not exist, device would not know which tenant to register for.

AD connect configuration has a step in which SCP is configured. So after running AD connect SCP will be created. You can validate this by running the following command and remove it if it exists.
"$scp = New-Object System.DirectoryServices.DirectoryEntry;

$scp.Path = "LDAP://CN=62a0ff2e-97b9-4513-943f-0d221bd30080,CN=Device Registration Configuration,CN=Services,CN=Configuration,DC=fabrikam,DC=com";

$scp.Keywords;"

Ref: https://docs.microsoft.com/en-us/azure/active-directory/devices/hybrid-azuread-join-manual#configure-a-service-connection-point

image

@lightupdifire
Copy link

@ManojReddy-MSFT,

So seems like it is not possible to prepare environment to block auto registration without running ADConnect wizard, is it so?

So maybe steps should be re-ordered for "Controlled validation of hybrid Azure AD join on Windows current devices", something like:

  1. Run ADConnect configuration wizard, this will add SCP entry
  2. Right after ADConnect configuration wizard deployed for AADHJ, clear the Service Connection Point (SCP) entry from Active Directory (AD) if it exists
  3. Configure client-side registry setting for SCP on your domain-joined computers using a Group Policy Object (GPO)
  4. If you are using AD FS, you must also configure the client-side registry setting for SCP on your AD FS server using a GPO

@SanDeo-MSFT
Copy link
Contributor

SanDeo-MSFT commented Jun 20, 2019 via email

@lightupdifire
Copy link

lightupdifire commented Jun 21, 2019

@SanDeo-MSFT

That is the main question from me, how exactly stop auto-register.
If I start following like "how to deploy hybrid" then I need to run: ADConnect for federated domain
If I will run wizard of ADConnect for federated domain, then auto-register can happen.
I cannot do "controlled validation" first, because if I will not run wizard of ADConnect for federated domain, then SCP record not added.

So I think best will be to do:

  1. Run ADConnect for federated domain
  2. Monitor SCP and as soon as added clear it out
    Follow rest steps 3 & 4 from above.
    And final step 5, for our few "Down level" devices add SCP & trusted sites in registry and deploy client.

@lightupdifire
Copy link

@SanDeo-MSFT @ManojReddy-MSFT

Because we don't need any other device or any auto-register process to be done at all, only few required "Down level" devices,

Do you confirm that the best steps, to stop auto-register, will be by doing this setup in following order:

  1. Run AD-Connect wizard to enable Azure AD Hybrid join for federated domain;
  2. Monitor SCP and as soon as added, clear it out;
  3. For ADFS, configure the client-side registry setting for SCP on ADFS servers using a GPO/manually
  4. For few required "Down level" devices, add SCP in registry, add trusted sites and deploy client.

@lightupdifire
Copy link

lightupdifire commented Jun 21, 2019

And btw. did anyone tested by doing:

  1. Having already Hybrid Azure AD Join enabled for Federated/Managed domain in AD-Connect
  2. So SCP cleared from domain
  3. Run AD-Connect client version upgrade/update or check if there was auto-update done
  4. Check if SCP added automatically back by AD-Connect version update process

?

@lightupdifire
Copy link

@SanDeo-MSFT @ManojReddy-MSFT

Hope you are doing fine, if possible, please would be great to have comment on last 2x questions.

@ManojReddy-MSFT
Copy link
Member

@lightupdifire Apologies for the delay. The action plan you have looks good.

Updating AD Connect will not affect the SCP configuration unless you rerun the configuration wizard.

@lightupdifire
Copy link

@ManojReddy-MSFT,

Thanks, we plan deployment this/next week and want to make sure, that we really can stop Hybrid Azure AD join, after configuration wizard completed,
Then do HybridAADJ only for 1x Down-level device,
But even ADConnect run on Windows 2016 on-premise domain joined server :)
I guess u can "re-close" this case,
I will for sure share our experience here.

@ManojReddy-MSFT
Copy link
Member

@lightupdifire Sure. I am looking forward to hearing back from you.

Copy link

@SanDeo-MSFT @ManojReddy-MSFT

We run deployment, in result:

  1. Down-level devices cannot register, errors:
    a) "The registration service could not successfully authenticate your account. Please make sure you are logged in with your Active Directory domain account and try again."
    b) "Hybrid Azure AD Join error: Error Message: Failed to navigate to"

  2. Current devices registering automatically, even SCP cleared from on-prem AD,
    At least we see this with Windows 10 devices, Windows Servers 2016 don't have this issue.

So in summary, I think "Controlled" process not very well running,
Also SCP record created in both location, in the domain and in the domain forest.

Copy link

lightupdifire commented Jul 12, 2019

@SanDeo-MSFT @ManojReddy-MSFT

After troubleshooting found following:

  1. When we run setup, seems the 5-10 seconds for clearing "keywords" was enough, to make some PC's start registering, this is why we saw some Win10 start register
  2. When creating SCP record in AD FS and Current Devices, can use tenant name, example: contoso.onmicrosoft.com
  3. When creating SCP on Down-level device, need use federated domain, example: contoso.com

In summary, controlled worked well, but I would advise maybe to add in doc, to run script to clear records and make script loop continuously while run wizard.
If used domain and forest, then SCP record added in both, so both must me SCP cleared.
When deploy Down-level agent, it is adding needed sites to the Intranet zone, so no need to add.

Thanks for helping out! Have a great all ahead ;)

Copy link
Contributor

@lightupdifire
The key thing to remember when you are doing a controlled validation for hybrid Azure AD join is to skip SCP configuration using Azure AD Connect. So if you are using AD FS, then you need to configure the required AD FS claims. We recommend you use Azure AD Connect to configure AD FS claims. So when using it, make sure you skip SCP configuration. This way it does not get written in AD and you do not have to worry about clearing it. Then all you do is configure SCP on the client side and those devices will start registering with Azure AD as hybrid Azure AD joined. If you are not using AD FS and instead using Azure AD authentication using password hash synchronization (PHS) or pass-through authentication (PTA), then for registering down-level devices as hybrid Azure AD join, you have to ensure Seamless Single-Sign-On is enabled as well.
Hope this helps.
Thanks

@PRMerger19 PRMerger19 added the Pri1 label Aug 1, 2019
Copy link

I too am confused by this article and have been far more enlightened by this comment thread than the article itself.

Suggestion: Please update the article with any relevant information shared in this thread. People should be able to read the article and get what they need in terms of configuration steps.

Question @SanDeo-MSFT , @ManojReddy-MSFT : I am working on a controlled Hybrid Join deployment in our managed (pass-hash) environment of win10 computers. I'm still not totally clear on the steps, so please verify or correct what I have listed below:

  1. Remove Azure AD registration from any registered devices that we plan to hybrid join.
  2. Sync device OUs in AD Connect (we currently only have users/groups synced).
  3. DO NOT enabled hybrid join in AD Connect.
  4. Verify SCP does not exist in on-prem AD (it doesn't, I already checked).
  5. Configure SCP on client side.

After completing the steps above, any clients that have SCP configured should begin to hybrid join, correct?

Thanks

@ManojReddy-MSFT
Copy link
Member

@JoelHazelton Apologies for the delayed response. Your action plan looks good. Only devices with SCP configured on the client-side will be joined to Azure AD.

I will work with the author to enhance the doc.

@lightupdifire
Copy link

lightupdifire commented Aug 20, 2019

@JoelHazelton

Sharing my experience when we run Hybrid AAD Join for ADFS solution:

  1. Verify SCP does not exist in on-prem AD (it doesn't, I already checked). -> it doesn't exist, until you run AD Connect wizard to do configuration for Hybrid Azure AD Join.

  2. SCP - as far understood, this step can be skipped during wizard of AD Connect, but to be honest,
    didn't saw that option... so what we did is: A) we run AD Connect wizard B) same time we monitor domain and domain forest for SCP record in AD via ADSI edit and by PowerShell C) As soon as SCP show up in AD we clear it out, it was added in both, domain and domain forest, both cleared.

  3. After AD Connect wizard completed, after few weeks, our Azure AD security center send us message that windowstransport for proxy for extranet become open, so we have to close it down.

  4. We added SCP on ADFS servers and on devices that must be Hybrid AAD joined manually by registry, as we don't have many devices for this setup, where registry SCP TenantName should be federated domain name.

If critical for you, then monitoring and clearing SCP should be done quick, we saw some devices start register very quick, we got ~5 devices in ~10 sec while we cleared SCP.

@JonesMikael
Copy link

I'd love to hear a comment from Microsoft when this might be fixed. Does it require an update of all Windows 10 devices to a new version for example? Even though we have a work around, it's not pretty.

Copy link

Hello,

It's now 2020 and all of the useful information resides under this 'closed' feedback topic, which I find very annoying.

If device registration GPO doesn't work and you're suggesting that clearing the device registration SCP from Active Directory and using the ClientSideSCP Method is the only way to achieve a controlled rollout, could you please remove the below article, as it was the the first result on Google when I typed "Controlled roll out of Hybrid AD" -

https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-fed-hybrid-azure-ad-join-post-config-tasks

If you could also update this article with any relevant information that would be great.

Too much conflicting information which is clearly confusing everyone!

Copy link

Also, is there any ETA on when the device registration GPO will be working again? As I say, there is conflicting information on the internet regarding this topic and it would be good understand if this is still an issue or not.

Copy link

testad commented Apr 20, 2020

I fully agree with @jakeives95. I have learned far more from this thread than from the documentation. Both this this article and "Configure hybrid Azure AD join for federated domains" needs to be more clear around which options to use when. Didn't even know about the third article @jakeives95 he just linked to. I will ignore that one considering it has not been edited since 2018.

We just started a controlled rollout thinking that the steps in this guide would be enough. However, what this guide fails to include is the fact that AD FS also needs claim rules configured - and not only to the SCP as referred to under "Configure AD FS settings". Please update this article to notify people that AD FS claim rules will need to be configured via AAD Connect or manually for a fully supported join. I know that some devices will registered without the claim rules due to the fallback option, but the fact that this information is left out resulted in a full day of troubleshooting and a delayed rollout. Some devices manage to use the fallback and other don't, so this articles is not applicable for AD FS environments unless claim rules are configured in advance. There are also other prerequisites about proxy etc. that this article leaves out.

I would even advise to migrate this article it to "Configure hybrid Azure AD join for federated domains" and "Configure hybrid Azure AD join for managed domains" - then remove it. Otherwise it needs to be updated to include all the details discussed in this thread. For example, add a section under the other tutorials for "Follow these steps to enable a per-device enrollment via GPO" and make it clear that the option would be to auto-join everything outside of your control. Then include the incredibly important step from @SanDeo-MSFT at 1 August 2019, about skipping the SCP configuration in the AAD Connect Wizard.

@closedstack
Copy link

closedstack commented Sep 22, 2022

It is now 2022 and the GPO to prevent Auto Azure AD Join still does not work. Moreover, when you are on a restricted network that does not have full internet access, you login is slowed down by 2 minutes. It has to time out trying to connect to azure before falling back to local authentication on Azure AD joined machines. If I run dsregcmd /leave, the machine still get re-joined to Azure AD after some time. This is despite having the registry to BlockAADWorkplaceJoin in place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests