I should probably blog this kind of thing but I'm too busy or too lazy. Maybe 
someone will find this handy though. For reason the IsManged flag for mobile 
devices in ConfigMgr is always set to true. I needed to know which devices 
connected to EAS were enrolled in MDM and which are not so I came up with this. 
Hope someone finds it helpful.......

SELECT
CASE WHEN IsCompliant = '1' THEN 'Device is enrolled'

             ELSE 'Device is not enrolled'
     END as 'Enrollment Status',
deviceid as 'Device ID',
FriendlyName 'Device Name',
UserName 'User',
DeviceOS 'Operating System',
DeviceType 'Device Type',
DeviceModel 'Device Model',
ExchangeServer 'Exchange Server Connected',
max ((left (FirstSyncTimeUTC, 11))) as 'First Sync Time',
max ((left (LastSuccessSyncTimeUTC, 11))) as 'Last Sync Time'

FROM EAS_Property

where DATEDIFF(d,LastSuccessSyncTimeUTC,GetDate()) < 7 and IsCompliant = '0'

group by

IsCompliant,
deviceid,
FriendlyName,
UserName,
DeviceOS,
DeviceType,
DeviceModel,
ExchangeServer,
FirstSyncTimeUTC,
LastSuccessSyncTimeUTC


________________________________
        John Marcum
               MCITP, MCTS, MCSA
               Desktop Architect
   Bradley Arant Boult Cummings LLP
________________________________
    [MVP] <https://mvp.microsoft.com/en-us/overview>
          [MMS] <http://mmsmoa.com/>


________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.



Reply via email to