Deleted user comes back if the user access to the site as a member of a group

%3CLINGO-SUB%20id%3D%22lingo-sub-1127041%22%20slang%3D%22en-US%22%3EDeleted%20user%20comes%20back%20if%20the%20user%20access%20to%20the%20site%20as%20a%20member%20of%20a%20group%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1127041%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20SPO%20site%20called%20contoso.sharepoint.com%2Fsites%2Fsales%2C%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3Eadmin1%40contoso.com%20is%20a%20member%20of%20%22admin%20group%22%20security%20group.%3CBR%20%2F%3Eand%20%22contoso%20owners%22%20group%20is%20a%20member%20of%20contoso.sharepoint.com%2Fsites%2Fsales%20site%20groups.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EFirst%2C%20I%20added%20admin1%40contoso.com%20to%20%22contoso%20owners%22%20group.%26nbsp%3B%3C%2FP%3E%3CP%3ENext%2C%20added%20%22admin%20group%22%20to%20%22contoso%20owners%22%20group.%3C%2FP%3E%3CP%3ERunning%20Get-SPOUser%20against%20contoso.sharepoint.com%2Fsites%2Fsales%20returns%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Econtoso%20users%26nbsp%3B%3C%2FP%3E%3CP%3E----------------%3CBR%20%2F%3E%3CSPAN%3Eadmin%20group%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eadmin1%40contoso.com%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThat%20is%20no%20problem.%20Then%20I%20removed%20%22admin1%40contso.com%22%20from%20%22contoso%20owners%22%20group%20by%20Remove-SPOUser%20and%26nbsp%3BGet-SPOUser%20returns%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Econtoso%20users%26nbsp%3B%3C%2FP%3E%3CP%3E----------------%26nbsp%3B%3CBR%20%2F%3E%3CSPAN%3Eadmin%20group%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20good%20so%20far.%20However%2C%20if%20admin1%40contoso.com%20access%26nbsp%3Bcontoso.sharepoint.com%2Fsites%2Fsales%20site%20with%20a%20browser%20(admin1%40contoso.com%20is%20a%20member%20of%20admin%20group)%2C%26nbsp%3BGet-SPOUser%20returns%20%22contoso%20owners%22%20group%20and%20admin1%40contso.com%20again.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3Econtoso%20users%26nbsp%3B%3C%2FP%3E%3CP%3E----------------%3CBR%20%2F%3E%3CSPAN%3Eadmin%20group%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eadmin1%40contoso.com%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EAny%20ideas%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1127041%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGet-SPOUser%20Sites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1130722%22%20slang%3D%22en-US%22%3ERe%3A%20Deleted%20user%20comes%20back%20if%20the%20user%20access%20to%20the%20site%20as%20a%20member%20of%20a%20group%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1130722%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F390617%22%20target%3D%22_blank%22%3E%40motoki%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20got%20a%20response%20from%20MS%20support.%3C%2FP%3E%3CP%3EThe%20person%20is%20explaining%20that%20it%20is%20not%20feasible%20to%20get%20a%20list%20of%20the%20current%20SPO%20users%20using%20Get-SPOUser%2C%20because%20Get-SPOUser%20returns%20deleted%20users%20as%20well%20as%20active%20users%20of%20the%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20that%20true%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EMotoki%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I have a SPO site called contoso.sharepoint.com/sites/sales,  
admin1@contoso.com is a member of "admin group" security group.
and "contoso owners" group is a member of contoso.sharepoint.com/sites/sales site groups.

First, I added admin1@contoso.com to "contoso owners" group. 

Next, added "admin group" to "contoso owners" group.

Running Get-SPOUser against contoso.sharepoint.com/sites/sales returns 

 

contoso users 

----------------
admin group

admin1@contoso.com


That is no problem. Then I removed "admin1@contso.com" from "contoso owners" group by Remove-SPOUser and Get-SPOUser returns 

 

contoso users 

---------------- 
admin group

 

It is good so far. However, if admin1@contoso.com access contoso.sharepoint.com/sites/sales site with a browser (admin1@contoso.com is a member of admin group), Get-SPOUser returns "contoso owners" group and admin1@contso.com again.

contoso users 

----------------
admin group

admin1@contoso.com


Any ideas? 

1 Reply

@motoki 

 

I have got a response from MS support.

The person is explaining that it is not feasible to get a list of the current SPO users using Get-SPOUser, because Get-SPOUser returns deleted users as well as active users of the site.

 

Is that true?

 

Regards,

Motoki