Power Shell Script to find and delete orphaned users from site

Power Shell  Script to get orphaned users from SharePoint Site.

Who are orphaned users?
Orphaned users are those who are disabled/removed from Active directory.

avoid user to still exist in the SharePoint People picker.

If we want delete few users only then browse to following url of your site delete user from there.

http://<SharePoint Server Name>:<Port No>/_layouts/people.aspx?MembershipGroupId=0 
   
using above URL We get all the list of users who exist in Site Collection. We can even delete any user from this URL, but it will remove from the complete Site Collection 

We can also query the users alternatively from SQL server

 1 : Open SQL Server Management Studio

SELECT * FROM [Sharepoint_Content _DB].[dbo].[Detailed User information] WHERE tp_Login='DOMAIN\UserID'        


2: record the tp_Id value, based on this  we can get user reference.

3: Go to http://<Site_Collection_Address>_layouts/userdisp.aspx?ID=tp_ID,


Comments

Popular posts from this blog

[Solved ] ...The product key entered does not match any of the Windows images available for installation. Enter a different product key

SharePoint Search Service application content sources showing Paused

User Profile Synchronization Service Struck on "Starting" - Fixed