We are pre-configuring our mobile device fleet through Apple DEP into our hybrid InTune / SCCM instance.

We have a few different enrolment profiles based on what the device is used for. With this, we also have policies and apps that we want to apply based on what enrolment profile is used.

I can't for the life of me find anything that can be used in a query that can provide that information!

enter image description here

If you click 'Show assigned devices' it shows a dynamic collection with the devices, but you can't see what the query is as 'Properties' just takes you to the Profile properties.



My answer below resulted in a query that worked, but could not be used as a 'Collection' query. I've created another query that returns that correct objects for a collection which is:

select 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_MDMCorpOwnedDevices on SMS_MDMCorpOwnedDevices.SerialNumber = SMS_R_System.SerialNumber where SMS_MDMCorpOwnedDevices.RequestEnrollmentProfileId = "1B64A5DE-861A-49DD-8076-57DB83028FE7"

My original answer:

The specific answer is:

SELECT * FROM SMS_MDMCorpOwnedDevices WHERE RequestEnrollmentProfileId = '34557E5D-DAA1-412D-82DF-5CD2E8D2A640'

Replacing the UID with the UID of the specific enrolment profile.

I found this by monitoring the SMSPROV.log file on the management server and clicking the 'Show enroled devices' in the console.

  • For some reason this cant be used as a 'collection' query, I'm guessing because it doesn't return a 'System' object. – mhouston100 Nov 13 '17 at 21:02

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.