Microsoft Technical Takeoff
Nov 27 2023 07:00 AM - Nov 30 2023 11:30 AM (PST)
Microsoft Tech Community

Remove not active devices

Iron Contributor


Anyone knows if there is an option to do auto-clean up of devices which is not active? Like if devices is not connecting for more than a month, it should be deleted automaticaly.

Or i can do that only by using Graph API and scripting that?

5 Replies
best response confirmed by Alexander Vanyurikhin (Iron Contributor)

Hey Alexander,


At the moment it's only available through Graph API. A sample script can be found here:


Best regards,

Ruud Gijsbers

Thank you!

You're welcome. Glad I could help.

Hi Alexander,


In the meantime it is also available through the Intune Portal. You can create a device cleanup rule. Per Larsen has described this on his blog:


Best regards,

Ruud Gijsbers

Yes, that feature was released after my post. I'm using that now, however it would be nice to minimize time from 90 to 30 days.