question

net1994-7989 avatar image
0 Votes"
net1994-7989 asked saldana-msft edited

Querying AutoPilot devices in MECM?

Hello – We are starting to use Auto Pilot in a testing environment. The AP devices are the only Azure AD joined devices in our environment, we don’t use AAD Hybrid Join. These AP devices are co-managed by our on-premises Endpoint Configuration Manager. I wanted to create a collection in MECM that will show these AP devices. After quite a bit of trial and error, the below query seems like the only way to show AutoPilot devices for us.

select * from SMS_R_System inner join SMS_Client_ComanagementState on SMS_Client_ComanagementState.ResourceId = SMS_R_System.ResourceId where SMS_Client_ComanagementState.AADJoined = 1

The above query shows all of our AP systems, with one exception. We took a AP device and on the MECM console we deleted it. Then we sent a ‘Wipe’ command from the MEM web console. It did that fine and then it was joined again as a AutoPilot device. The system (with the same name as before if that matters) shows up in MECM and MEM consoles as expected. However the system isn’t shown in the collection with the above query. Is the query correct? If an existing AP system that is co-managed by MECM reused, would it not show up in that query? I’m assuming it still should.

Thoughts?

mem-cm-generalmem-autopilot
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AllenLiu-MSFT avatar image
0 Votes"
AllenLiu-MSFT answered

Hi, @net1994-7989
Thank you for posting in Microsoft Q&A forum.
You may try the query for devices Enrolled for Co-Management:
select distinct SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_Client_ComanagementState on SMS_Client_ComanagementState.ResourceID = SMS_R_System.ResourceId where SMS_Client_ComanagementState.MDMEnrolled = 1


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.