Forum Discussion
Guest Users governance - stale guest users
Hello All
I want to reach out to community and ask how admins are managing and creating governance around Guest users (external users).
In O 365 tenant users can invite non-tenant users to participate in Teams or in SharePoint sites. But after the project is complete, they forget to remove them from the Team or Site. Also we see a lot of Guest users in Azure AD tenant that have not logged in last 30 days (I am using Azure AD Sign in logs to see this info). For obvious security reasons, we don't want to leave these Guest users active in our tenants. I know we can get list of external users and their sign in data using Graph API. But my question is more around best practices.
Are there any best practices on how to handle stale guest users? I did not see any MS official documentation around this topic. Please share your governance policies that you have setup for guest users.
TIA.
The "best practice" will vary greatly from one organization to the other, as some are very "open" in regards to guest users, other must allow their partners and customers, while organizations in certain industries will never even enable such a feature. Microsoft's own tool to manage guest user lifecycle is called Access Reviews (https://docs.microsoft.com/en-us/azure/active-directory/active-directory-azure-ad-controls-manage-guest-access-with-access-reviews), but unfortunately the license requirements are very prohibitive for any organization not already invested in AAD Premium P2.
PowerShell and the Graph API give you all the tools you need in order to manage Guest users, so you can build your custom solution around it, if the above is too costly.
- kiran bellalaBrass Contributor
VasilMichev thank you for your response.
I agree with you that Azure AD Premium P2 is expensive hence I am building my scripts and tools for External user management. Just wanted to ask community how long are you leaving an external user in Azure AD. We cannot leave inactive external users forever in the tenant.
Running the script/tool on a monthly basis seems like a sensible approach. But again, depends on the organization policies, some organizations will be perfectly fine doing the cleanup once per quarter.
- Sandra BoydCopper Contributor
Does anyone have a Power Shell script that would provide a list of stale guest accounts with the last log in date for users who don't have a mailbox? External users who have been granted access to sites or documents in classic SharePoint sites and modern Team and Communication sites don't have mailboxes.
- Joshua BinesIron ContributorNow you do... 🙂 https://github.com/JBines/Remove-StaleGuests
- T11EJDCopper Contributor
Hi, old thread, Ive just posted a similar question:
What I found interesting is that SP has the power to create a guest tenant but not the reverse. Seems odd that when deleting a User from an SP site the option isn't presented to remove the AD tenant. In addition any SP sites that are deleted should present the Guest User Tenants to be remove also..... if the Guest User Tenant is in use on another Site then a simple warning/pop up to say "not removed as in use on other Sites"
One issue Ive thought of is the 1:5 ratio of LicenseUser:GuestUser…… how did you overcome this? Or did you keep paying for additional Tenant Licenses?
- sintra3000Copper Contributor
I have the same issue. This must be a relevant problem for a lot of organisations, and the fact that it is hard to disable stale guest users, let alone identify them, is incredible. The access reviews Microsoft pushes are worthless. What is needed is a catch all script that disables all guest accounts not signed in during the last X days.
- You have replied to a post being 3 years old. If you've read the conversation you'd see that there's actually a script added for doing just that https://github.com/JBines/Remove-StaleGuests
The access reviews are great btw removing guest users not responding for ex.
A quick search got me here as well
https://github.com/12Knocksinna/Office365itpros/blob/master/FindOldGuestUsers.ps1- sintra3000Copper ContributorThank you, the script looks like it could fix some issues. However, I would hope that Microsoft could come up with a more 'official' solution. If I were to use this script in a prod environment, which guarantees do I have it works, if this is a best-effort solution from JBines.
As for the access reviews, users not comfortable with English, guest users not having any clue about their own group memberships, etc etc makes them not suitable for our needs. When Microsoft security engineers push clean-up of inactive users as a high priority, I would assume their flagship product Azure could support user friendly ways of ensuring this.