SOLVED

How to remove user from the list if user does not exist?

%3CLINGO-SUB%20id%3D%22lingo-sub-844535%22%20slang%3D%22en-US%22%3EHow%20to%20remove%20user%20from%20the%20list%20if%20user%20does%20not%20exist%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-844535%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20SharePoint%20Online%2C%20and%20custom%20list%20with%20People%20Picker%20for%20User%20Names%2C%20we%20have%20added%20users%20in%20that%20list%20in%20the%20past%20and%20using%20that%20list%20reading%20our%20Scheduler%20to%20send%20email%20notifications.%20Now%20some%20of%20the%20users%20we%20removed%20from%20the%20Tenant%20and%20How%20can%20we%20check%20and%20remove%20user%20from%20this%20list%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3E-Sal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-844755%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20remove%20user%20from%20the%20list%20if%20user%20does%20not%20exist%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-844755%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F406064%22%20target%3D%22_blank%22%3E%40Sal_Sal%3C%2FA%3E%26nbsp%3BHi%26nbsp%3B%20there.%20You%20want%20to%20remove%20users%20in%20a%20list%20column%20and%20these%20users%20gets%20notification%20from%20the%20scheduler.%20One%20approach%20could%20be%2C%20you%20can%20modify%20your%20scheduler%20code%20which%20will%20check%20the%20users%20first%20and%20then%20if%20they%20see%20the%20requested%20user%20is%20not%20valid%20anymore%20can%20be%20removed%20from%20the%20list%20item%20and%20then%20can%20be%20replaced%20with%20some%20generic%20account%20or%20emptied%20which%20will%20let%20you%20know%20the%20users%20who%20are%20invalid.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESecond%20approach%20is%20have%20complete%20separate%20scheduler%20which%20runs%20less%20often%20dues%20this%20type%20of%20clean%20up%20job%20from%20multiple%20lists%20of%20libraries.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eplease%20let%20me%20know%20if%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-846502%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20remove%20user%20from%20the%20list%20if%20user%20does%20not%20exist%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-846502%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394813%22%20target%3D%22_blank%22%3E%40Vikram_Samal%3C%2FA%3E%26nbsp%3B%20Thank%20you%20vikram.%20Can%20something%20like%20this%20I%20can%20do%20with%20designer%20workflow%20on%20the%20list%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-848776%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20remove%20user%20from%20the%20list%20if%20user%20does%20not%20exist%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-848776%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F406064%22%20target%3D%22_blank%22%3E%40Sal_Sal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsually%20when%20user%20account%20is%20deactivated%20in%20active%20directory%2C%20it%20adds%20'%24%24%24'%20in%20the%20display%20name%20of%20user.%20So%20checking%20%24%24%24%20in%20the%20display%20name%20could%20be%20one%20check%20before%20you%20try%20to%20send%20an%20email%20would%20be%20one%20option.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20also%20check%20if%20below%20links%20help%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fremove-users%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fremove-users%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi,

I have SharePoint Online, and custom list with People Picker for User Names, we have added users in that list in the past and using that list reading our Scheduler to send email notifications. Now some of the users we removed from the Tenant and How can we check and remove user from this list?

 

Thanks,

-Sal

3 Replies
Highlighted
Solution

@Sal_Sal Hi  there. You want to remove users in a list column and these users gets notification from the scheduler. One approach could be, you can modify your scheduler code which will check the users first and then if they see the requested user is not valid anymore can be removed from the list item and then can be replaced with some generic account or emptied which will let you know the users who are invalid.

 

Second approach is have complete separate scheduler which runs less often dues this type of clean up job from multiple lists of libraries. 

 

please let me know if this helps.

Highlighted

@Vikram_Samal  Thank you vikram. Can something like this I can do with designer workflow on the list?

Highlighted

@Sal_Sal 

Usually when user account is deactivated in active directory, it adds '$$$' in the display name of user. So checking $$$ in the display name could be one check before you try to send an email would be one option.

 

You can also check if below links help you.

 

https://docs.microsoft.com/en-us/sharepoint/remove-users