How to run a query to show devices in maintenance mode