Microsoft.SharePoint.Client.UserProfiles.PeopleManager
Once you've got a collection of users you migth quite well be able to delete them.
Hi,
The tenant has Azure AD Connect to sync on-premise AD users to Azure AD.
SharePoint User Profiles is created based on the users in Azure AD.
This works fine! :)
When a user is deleted from local AD, it is also deleted from Azure AD.
But the User Profile in SharePoint is not deleted.
How can I purge and remove all User Profiles for non exisiting users in Azure AD?
I have not found any powershell cmdlet or scripts to do this or to help me find all user profiles.
Check the script in the below blog, this should work for you.
Are there negative ramifications to doing this? I guess I've assumed they were left in there for a reason. Would it affect pages or list items that deleted user might have created?
Hi Deleted,
Interesting question.
I came across this article:
The script in question will need to be modified a bit, but it will get you all the user profiles from
Microsoft.SharePoint.Client.UserProfiles.PeopleManager
Once you've got a collection of users you migth quite well be able to delete them.