question

onetech-it avatar image
0 Votes"
onetech-it asked onetech-it answered

Any way to automatically purge 'stale' Guest accounts from Azure AD?

We have a large number of Azure AD Guest accounts, that haven't been used for many months (sometimes over a year) and I'd like to be able to 'purge' them all from the system in a single pass.

Is there a method for doing this? Or would I literally have to remove them one at a time?

azure-ad-user-managementazure-ad-b2b
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @onetech-it , the best way to mass-remove stale devices is by using a PowerShell script. You can get the list of stale devices, return them in a .csv, and then remove them.

184259-stale.png

The full code and explanation can be found in the document I linked above. Please let me know if you have any questions.

If this answer helped you please mark this answer as "Verified" so other users can reference it.

Thank you,
James


0 Votes 0 ·
stale.png (143.1 KiB)
JamesHamil-MSFT avatar image
0 Votes"
JamesHamil-MSFT answered

Hi @onetech-it , I'm really sorry I misunderstood your question! For stale guest user accounts, there's a really good writeup here by Darren Robinson. The method is very similar to what I posted above. If you have any questions or if there's any disconnects within the document please let me know. I can help you further if so!

If this answer helped you please mark it as "Verified" so other users can reference it.

Thank you,
James


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

onetech-it avatar image
0 Votes"
onetech-it answered

How does this relate at all, to stale GUEST USER accounts?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

onetech-it avatar image
1 Vote"
onetech-it answered

Hi James,

Thank you so much. That write up is exactly what I'm looking for!

Best,

OneTech IT

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.