A common question that we are asked is “How do I remove users from my BrightWork site collection?” And more specifically the “My Work” user drop downs.
It’s quite common for SharePoint administrators to synchronize their Active Directory with the BrightWork Site collection. This is a bad procedure for two reasons.
- Your “My Work” user choice menus will be flooded with users which bare no relevance and this causes delays navigating for those who use the site.
- You have probably broken the limit of user licenses that you have purchased in your BrightWork license agreement, although they many of the names listed are not using BrightWork.
Removing users from a site collection is a very simple task. This blog outlines how to delete a user from a SharePoint site collection.
*Warning: This does remove this SharePoint entry from the entire site collection.
Use with care.
Remove User from a Site Collection:
- Firstly you must be logged on with site collection admin rights.
- Ensure that you are at the root (top level) of your site collection.
- You want to remove the /default.aspx from your URL i.e. https://2016.brightworkdemo.com/sites/cmccarthy/default.aspx becomes https://2016.brightworkdemo.com/sites/cmccarthy
- Now add the following hidden view portion to the URL… _layouts/people.aspx?MembershipGroupId=0 which leaves you with a complete URL: https://2016.brightworkdemo.com/sites/cmccarthy/_layouts/people.aspx?MembershipGroupId=0
- Hit Enter. You will now see the hidden view and the list of all users in the site collection.
- Click on the username(s) of the user you want to remove.
- Under Actions, click Delete User from Site Collection.
- Click OK on the warning message, and the user will now be gone from the site collection, freeing you up a BrightWork license!
Delete User with PowerShell
Do you want to use PowerShell instead? You can adjust the script below, entering your site collection name and the user account names.
Add-PSSnapin microsoft.sharepoint.powershell -ea continue
$site = Get-SPSite “https://[SiteCollectionName]”
$web = $site.RootWeb
$list = $web.Lists[“User Information List”]
$i = $list.Items | where {$_[“Account”] -eq “<UserAccountName>”}
$i.Delete()
$web.Dispose()
$site.Dispose()
Would you like to do more housekeeping and maintenance? Check out how you Change a SharePoint User Display Name with PowerShell
(Original article dated 18 Jan 2013, update for SharePoint 2013 and 2016)