Hi, Thanks for bringing this up, I have modified the step 5 to use 'Run
command line' instead of 'install package' [ the package is created
without a program]. and of course we can use ps1 or just run command
line step with these reg add commands directly in this TS step.

Agree, this should not require manual scripting. It should be a tick box
in Azure AD [v] Delete Stale objects after number of days: and you
should be able to select nunber of days. It’s already available in
Intune for enrolled devices. However, I do appreciate the time spent to
write this post :) Ma...

Hi, I was trying the steps you mentioned above. When, I try to add
registry keys as a command file it is in a loop. Not sure, If, I have
something wrong within the CMD file. I saved the file reg.cmd. I was
able to accomplish the task through PowerShell. Added each registry
entry individually and all...

Also you're making this too complicated by using the legacy MSOL
powershell module. If you just use the "new" AAD PowerShell module that
has been around for a few years now, you have what you need there. No
need for any random scripts/modules in the TechNet gallery.
Get-AzureADDevice | Select
Displa...

Why oh why is this still a manual process? This just doesn't make sense.
Why can't there be an automated solution (or at least one that doesn't
require running code) for clearing out stale devices? Users are able to
rejoin a device to AAD if they need to if it got cleared out of AAD due
to being sta...