@EnterpriseArchitect, Thanks for posting in Q&A. To remove the stale devices in Microsoft Entra ID, you can run the script in the following link:
https://learn.microsoft.com/en-us/entra/identity/devices/manage-stale-devices
To automatically delete devices which haven't checked in for this many days. you can set Device cleanup rules in Intune.
Hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.