mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-02-03 14:03:26 +00:00
Bug fix and tweak to query
+ Wrong table reference (bad copy/paste I'm sure) + Also only return devices that are still managed in the results
This commit is contained in:
@@ -212,10 +212,10 @@ mobile_devices_denormalized.is_managed = 1
|
|||||||
|
|
||||||
-- Mobile Devices that have failed to renew their MDM Profile
|
-- Mobile Devices that have failed to renew their MDM Profile
|
||||||
-- And the MDM Profile has already expired
|
-- And the MDM Profile has already expired
|
||||||
-- Remove the last AND condition to see all failed Renew MDM Profile Commands
|
-- Remove the last two `AND` conditions to see all failed Renew MDM Profile Commands
|
||||||
SELECT
|
SELECT
|
||||||
mobile_denorm.mobile_device_id AS "Device ID",
|
mobile_denorm.mobile_device_id AS "Device ID",
|
||||||
IF (sites_mobiles.site_name IS NOT NULL, sites_mobiles.site_name, "None") AS `Site`,
|
IF(sites_mobiles.site_name IS NOT NULL, sites_mobiles.site_name, "None") AS `Site`,
|
||||||
IF(mobile_denorm.is_managed = 1, "True", "False") AS "Managed",
|
IF(mobile_denorm.is_managed = 1, "True", "False") AS "Managed",
|
||||||
error_code AS "Error Code",
|
error_code AS "Error Code",
|
||||||
error_domain AS "Error Domain",
|
error_domain AS "Error Domain",
|
||||||
@@ -237,7 +237,9 @@ WHERE
|
|||||||
AND
|
AND
|
||||||
mdm_c.client_type IN ("MOBILE_DEVICE", "MOBILE_DEVICE_USER", "TV")
|
mdm_c.client_type IN ("MOBILE_DEVICE", "MOBILE_DEVICE_USER", "TV")
|
||||||
AND
|
AND
|
||||||
mac_denorm.mdm_certificate_expiration < UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 180 DAY))*1000
|
mobile_denorm.device_certificate_expiration < UNIX_TIMESTAMP(DATE_ADD(CURDATE(), INTERVAL 180 DAY))*1000
|
||||||
|
AND
|
||||||
|
mobile_denorm.is_managed = 1
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user