Avatar of Amal Nai
Amal NaiFlag for South Africa asked on

How to setup Intune BYOD migration automation?

Hello,


I am primarily trying to automate a process of moving user profiles on a device, which is connected to an on-prem AD, to Azure AD.

I have managed to try a number of things, however when trying to deploy a PPKG file to the device, it enrolls to MDM successfully and I am able to verify the device on Intune, but when running the "dsregcmd /status" command, it states that the device it not connected to MDM.

Doing this process manually works without any issues, but trying to automate this has given me so many headaches in the past week.


Any assistance or guidance will be appreciated.


Amal

Azure* MS Intune* Mobile Device Management (MDM)

Avatar of undefined
Last Comment
Amal Nai

8/22/2022 - Mon
Hayes Jupe

but dsregcmd doesn't tell you if a device is connected to intune (MDM) - it gives you a status on its directory connectivity.

https://docs.microsoft.com/en-us/azure/active-directory/devices/troubleshoot-device-dsregcmd
Jian An Lim

to know whether your device is synced and managed by intune,
you need to run
if (get-childitem HKLM:\\Software\Microsoft\PolicyManager\Providers) {"working with intune"} else {"not working"}

or look for the intune agent installer location

if (get-childitem "C:\Program Files (x86)\Microsoft Intune Management Extension\") {"working with intune"} else {"not working"}

not perfect but you got something to baseline

ASKER
Amal Nai

Hello Hayes and Jian,

Thank you very much for your replies.
Below is screenshots of what I'm facing:

Please remember that the purpose of this expedition is to automate the process of migrating a user from on-prem AD to Azure AD. Regardless of if I'm on an AD or using a local user, I receive the same results. This is also not device specific, as I have tried the same process on multiple devices.
Even if I assign the device to a primary user, it also doesn't do anything.
Am I missing a step or doing this wrong?

Kind Regards
Amal
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER
Amal Nai

Let me please clarify what I'm trying to do.

I want to add a PC to Azure AD.
As of this stage there is only 2 ways to do this, that I'm aware of:
1.   Manually using the “Connect” option in “Access work or school” in “Settings”.
2.   Using Windows Configuration Designer to create a PPKG file which you then run on the device to join it.

I don't want to do it manually to 600 users and using the PPKG file fails, hence my request for assistance.

Kind Regards
Amal
Jian An Lim

i need to understand what do you mean by "automate the process of migrating a user from on-prem AD to Azure AD "

User do not migrate from on-premises AD to azure AD, they are synced. i.e. account appeared in both on-premises AD and Azure AD.

that machine you provided is a workgroup machine,
AzureADJoined = False
EnterprisedJoin = false
Domainjoined = false

If it is intune (aka. compliant), mean you can use intune to manage it.
However, the user will stay EXACTLY the same. local user in your case. and will not able to logon using the Azure AD account.

If you intend to logon to the machine using your Azure AD user (email address and password), then your machine need in a state of
AzureADJoined = True
EnterprisedJoin = false
Domainjoined = false

That will require user to join it differently.

if you deploy the PPKG, that intend to be intune managed, thenthe screenshot did say it joined successfully. But it is not Azure AD Joined. 

ASKER CERTIFIED SOLUTION
Jian An Lim

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Amal Nai

Yes I did follow that process.
When checking the Event Viewer, I notice the following errors:
Maybe this leads to somewhere?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Jian An Lim

did you bulk token still valid?
ASKER
Amal Nai

Yes it is.
It is newly created as of this morning.
Successfully signed and retrieved.
ASKER
Amal Nai

This is so frustrating and weird.
I just re-tried to run the PPKG file and now it's working for some reason without any problems:
I'm going to reset the device and re-create the scenario.
I'll keep you guys posted.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Jian An Lim

if you reset it, you need to delete the object in Azure AD as well.
don't leave it half hanging
ASKER
Amal Nai

Thank you for that.
I will do.
ASKER
Amal Nai

@Jian An Lim, Thank you for your assistance in this matter.
Running the PPKG file again seems to have resolved it.

After tracing back my steps on what I did, it seems as though it was relating to a Device Configuration Profile that was incorrectly configured.
Upon testing why it wasn't working I deleted that, which seems to have fixed my problem.
I'm going to now re-create my config profile and see it's effects on the device enrollment.

Once again, I am very appreciative of your assistance.

Kind Regards
Amal
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.