I had similar issue with "orphan" unmanaged devices in Azure AD.
This is actually a pretty serious problem and there is no indication it exists until something weird happens, like user can't get latest policy updates or apps. In my experience we had ~3% of total PC population (out of 4000) affected by this. Btw, Microsoft Premier support was not able to identify a root cause or bring PCs back to management and proposed we do OS reinstall. But maybe your issue is different.
Anyway, back to the solution.
To detect orphan devices I used analytics.
Basically, we have to do this:
- Get the list of active managed devices from Intune
- Get the list of Windows sign-ins from Azure AD
- Eliminate managed Intune devices (1) from the list of devices in sign-in logs (2).
Voila! Everything what is left are devices which are being signed to, but not managed
Step 1: Get managed device list from Intune:
Step 2: Extract device names from sign-in logs:
- Go to Azure AD | Sign-in logs. Set Date to
1 month
. Filter by Application = Windows Sign In
.
- Click [Download] > Download JSON and save
InteractiveSignIns*.json
file to disk
- Launch Excel. Click Data (tab) - Get Data > From File > From JSON. Load your data file
- Next, click To Table in Transform (tab) > Convert menu, leave defaults and click [OK]
- You will get a single column named
Column1
, select the column, go to Transform (tab) and click [Expand]. Click [OK]
- Scroll until you find column named
Column1.deviceDetail
and expand it too the same way you just did to the other one
- Click [Close & Load]
Right now you have the list of computer names in Column1.deviceDetail.displayName
column. Though using device name is not 100% reliable, we are fishing for anomalies here. So we can't rely too much on IDs or isManaged
flag. Using names is a safe bet. Keep in mind that sometimes device names can change, so in the end your list might have some false positives. But this makes sure you won't miss a single orphan device
Step 3: Merge data
- Using same Excel file you used to extract sign-ins data - click Data (tab) - [From Text/CSV]. Load CSV file
Devices*.csv
you got from Intune before. Click [Load]
- Next, with one of the tables selected, go to Query (tab) and click [Merge]
- In the Merge dialog the first table selected should be
InteractiveSignins...
. Select column Column1.deviceDetail.displayName
- Pick
Devices...
table in the second drop-down, select Device name column
- For Join Kind select Left Anti
- Click [Close & Load]
Congrats! The table Merge1 will have logins from possible orphan Azure AD devices
I used Excel and manual data loading to keep things simple.
In my case I invested more time to automate data loading, do transformations and visualizations using Power BI, because the number of orphan devices was slowly growing. So it turned up to be a recurring task to identify and fix them