Home

Script to remove disabled users from SharePoint2013

%3CLINGO-SUB%20id%3D%22lingo-sub-283554%22%20slang%3D%22en-US%22%3EScript%20to%20remove%20disabled%20users%20from%20SharePoint2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283554%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20SP2013.%3CBR%20%2F%3EWe%20had%20some%20users%20leave%20the%20organization.%3CBR%20%2F%3EThey%20have%20been%20disabled%20in%20AD%20however%20they%20are%20still%20present%20on%20SharePoint.%3CBR%20%2F%3EIs%20there%20any%20easier%20way%20to%20remove%20these%20users%20who%20are%20disabled%20in%20AD%20to%20be%20removed%20from%20Sharepoint%20also%3F%3C%2FP%3E%3CP%3EAny%20script%20which%20will%20help%20me%3F%3C%2FP%3E%3CP%3Ethank%20you%20!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-283554%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2013%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esharepoint%202013%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-285356%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20to%20remove%20disabled%20users%20from%20SharePoint2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-285356%22%20slang%3D%22en-US%22%3EOn%20our%20SP%202010%20instance%20we%20would%20filter%20out%20deprovisioned%20employees%20based%20upon%20criteria%20from%20our%20Active%20Directory.%20For%20example%20clearing%20a%20field%20in%20AD%20when%20they%20were%20deprovisioned%2C%20this%20would%20then%20clear%20them%20from%20SharePoint%20fields%20(they'd%20still%20be%20on%20historic%20things%20but%20they're%20profiles%20would%20be%20gone).%3CBR%20%2F%3E%3CBR%20%2F%3EHere%20is%20an%20older%20reference%3A%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.harbar.net%2Farchive%2F2011%2F02%2F22%2F323.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.harbar.net%2Farchive%2F2011%2F02%2F22%2F323.aspx%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-283738%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20to%20remove%20disabled%20users%20from%20SharePoint2013%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-283738%22%20slang%3D%22en-US%22%3ETake%20a%20look%20to%20the%20TechNet%20Script%20Gallery...what%20you%20are%20looking%20for%20could%20be%20there%3A%20%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2F%3C%2FA%3E%20also%20the%20PowerShell%20gallery%3A%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.powershellgallery.com%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

We have SP2013.
We had some users leave the organization.
They have been disabled in AD however they are still present on SharePoint.
Is there any easier way to remove these users who are disabled in AD to be removed from Sharepoint also?

Any script which will help me?

thank you !!

2 Replies
Highlighted
Take a look to the TechNet Script Gallery...what you are looking for could be there: https://gallery.technet.microsoft.com/ also the PowerShell gallery: https://www.powershellgallery.com/
Highlighted
On our SP 2010 instance we would filter out deprovisioned employees based upon criteria from our Active Directory. For example clearing a field in AD when they were deprovisioned, this would then clear them from SharePoint fields (they'd still be on historic things but they're profiles would be gone).

Here is an older reference:
http://www.harbar.net/archive/2011/02/22/323.aspx
Related Conversations
Working with excel in Sharepoint desktop app
IanH1 in SharePoint on
2 Replies
Share Button added to the Toolbar!
HotCakeX in Discussions on
13 Replies
Make Share function in Edge more useful
HotCakeX in Discussions on
2 Replies
Intune Scripting
jesusleon in Microsoft Intune on
2 Replies
Sharing an excel sheet public link
shunde3 in Microsoft Teams on
6 Replies