Re-inviting disabled Guest Users

%3CLINGO-SUB%20id%3D%22lingo-sub-533396%22%20slang%3D%22en-US%22%3ERe-inviting%20disabled%20Guest%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-533396%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20contemplating%20a%20solution%20that%20will%20block%20sign-in%20for%20Guest%20Users%20that%20have%20not%20signed%20in%20for%20e.g.%20three%20months.%20I%20hoped%20that%20if%20a%20Guest%20Users%20that%20are%20blocked%2C%20are%20re-invited%2C%20the%20block%20would%20automatically%20be%20removed%2C%20but%20that%20is%20not%20the%20case.%20When%20I%20try%20to%20invite%20a%20blocked%20user%2C%20I%20get%20these%20messages%3A%20%22We%20couldn't%20add%20member%22%20and%20%22We%20ran%20into%20an%20issue.%20Please%20try%20again%20later%22.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anybody%20have%20a%20suggestion%20for%20how%20to%20do%20what%20we%20want%20to%20do%20in%20an%20effective%20way%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-742113%22%20slang%3D%22en-US%22%3ERe%3A%20Re-inviting%20disabled%20Guest%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-742113%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F28745%22%20target%3D%22_blank%22%3E%40Jakob%20Rohde%3C%2FA%3E%26nbsp%3BThe%20User%20would%20still%20be%20present%20you%20directory%20and%20would%20answer%20as%20to%20why%20you%20get%20the%20error%20when%20trying%20to%20invite%20them%20once%20more.%20Blocking%20is%20not%20the%20same%20as%20deleting%20a%20user.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-AzureADUser%20-Top%20%3CMAXIMUM%20nr%3D%22%22%20of%3D%22%22%20users%3D%22%22%20you%3D%22%22%20want%3D%22%22%20to%3D%22%22%20view%3D%22%22%3E%20%7C%20Where-Object%20%7B%24_.UserType%20-eq%20'Guest'%7D%20%7C%20Select-Object%20DisplayName%2C%20UserPrincipalName%2C%20AccountEnabled%2C%20mail%2C%20UserType%20%7C%20Format-Table%20would%20give%20you%20a%20view%20of%20what%20Guest%20Users%20you%20have%20in%20your%20directory%20and%20their%20status.%3C%2FMAXIMUM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReference%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fget-azureaduser%3Fview%3Dazureadps-2.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fget-azureaduser%3Fview%3Dazureadps-2.0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20run%20the%20commands%20above%20you%20need%20to%20have%20the%20Azure%20AD%20Module%20for%20Powershell%20installed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20then%20select%20the%20accounts%20you%20whish%20to%20re-enable%20from%20that%20list%20and%20run%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESet-AzureADUser%20-SearchString%20%22Username%40domain.com%22%20-AccountEnabled%20%24true%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EReference%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fset-azureaduser%3Fview%3Dazureadps-2.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fset-azureaduser%3Fview%3Dazureadps-2.0%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that%20is%20not%20what%20you%20are%20looking%20for%20regarding%20%22efficiency%22%20I%20would%20recommend%20deleting%20the%20user%20entirely%20from%20your%20directory%20as%20step%201%20instead%20of%20disabling%20the%20account.%20This%20would%20however%20require%20you%20to%20re-add%20the%20user%20to%20the%20groups%2C%20role%20assignments%20etc%20that%20the%20now-deleted%20user%20once%20had.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20some%20of%20this%20helps%20you!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%2F%2FViktor%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-757042%22%20slang%3D%22en-US%22%3ERe%3A%20Re-inviting%20disabled%20Guest%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-757042%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F28745%22%20target%3D%22_blank%22%3E%40Jakob%20Rohde%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20your%20situation%20the%20likely%20cause%20is%20blocking%20vs%20deletion%20-%20but%20for%20future%20reference%20I%20had%20a%20client%20that%20had%20a%20similar%20issue%20-%20but%20removing%20and%20deleting%20the%20user%20via%20Azure%20still%20did%20not%20allow%20the%20user%20to%20be%20re-invited%20(error%20was%20that%20user%20already%20existed).%20This%20was%20caused%20by%20a%20SharePoint%20object%20that%20was%20created%20for%20that%20B2B%20user%20that%20was%20invisible%20to%20the%20normal%20search%20tools.%20This%20user%20object%20was%20found%20by%20the%20SharePoint%20admin%20and%20manually%20removed.%20The%20user%20could%20then%20be%20re-invited.%20So%20if%20anyone%20comes%20across%20this%20situation%20this%20could%20be%20the%20underlying%20cause.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

We are contemplating a solution that will block sign-in for Guest Users that have not signed in for e.g. three months. I hoped that if a Guest Users that are blocked, are re-invited, the block would automatically be removed, but that is not the case. When I try to invite a blocked user, I get these messages: "We couldn't add member" and "We ran into an issue. Please try again later". 

 

Does anybody have a suggestion for how to do what we want to do in an effective way? 

 

2 Replies

@Jakob Rohde The User would still be present you directory and would answer as to why you get the error when trying to invite them once more. Blocking is not the same as deleting a user.

 

Get-AzureADUser -Top <maximum nr of users you want to view> | Where-Object {$_.UserType -eq 'Guest'} | Select-Object DisplayName, UserPrincipalName, AccountEnabled, mail, UserType | Format-Table would give you a view of what Guest Users you have in your directory and their status.

 

Reference: https://docs.microsoft.com/en-us/powershell/module/azuread/get-azureaduser?view=azureadps-2.0

 

To run the commands above you need to have the Azure AD Module for Powershell installed.

 

You could then select the accounts you whish to re-enable from that list and run the following:

 

Set-AzureADUser -SearchString "Username@domain.com" -AccountEnabled $true

 

Reference: https://docs.microsoft.com/en-us/powershell/module/azuread/set-azureaduser?view=azureadps-2.0

 

If that is not what you are looking for regarding "efficiency" I would recommend deleting the user entirely from your directory as step 1 instead of disabling the account. This would however require you to re-add the user to the groups, role assignments etc that the now-deleted user once had.

 

Hope some of this helps you!

 

//Viktor

@Jakob Rohde 

In your situation the likely cause is blocking vs deletion - but for future reference I had a client that had a similar issue - but removing and deleting the user via Azure still did not allow the user to be re-invited (error was that user already existed). This was caused by a SharePoint object that was created for that B2B user that was invisible to the normal search tools. This user object was found by the SharePoint admin and manually removed. The user could then be re-invited. So if anyone comes across this situation this could be the underlying cause.