When i tried to remove a user completely from a site collection(Went to Site Groups--> groupId=0 and removed the user), the user got deleted from all the groups but he is still possessing permissions somewhere.
Any Ideas..?!!
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityWhen i tried to remove a user completely from a site collection(Went to Site Groups--> groupId=0 and removed the user), the user got deleted from all the groups but he is still possessing permissions somewhere.
Any Ideas..?!!
Go to http://siteUrl/_layouts/15/people.aspx?MembershipGroupId=0
. From here, you can delete a user from the Site Collection.
It should be noted that the user will remain in the User Information List (dbo.UserInfo
) table in the Content Database the Site Collection resides in. This is for referential integrity purposes. They are simply marked as deleted.
DisplayName
, but different UserLogin
), and I can see there's 2 using powershell $web.AllUsers
, but in the SharePoint page, I see only the good one.
– Marc-André
Sep 26 '17 at 13:22
You can also try using the below powershell
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Root web
$web = Get-SPWeb "http://sharepoint.crescent.com/sites/operations"
#Supply the user account
$UserAccount = "Global\DaveP"
#Removes user from site collection
Remove-SPUser -Identity $UserAccount -Web $Web -Confirm:$False
It looks like the user is a site admin for this collection. You can check it in Center Administration or (if do not have access to central administration) with this simple code in csom.
using (var clientContext = new ClientContext("http://mysitecollection"))
{
var user = clientContext.Web.EnsureUser("user1");
clientContext.Load(user);
clientContext.ExecuteQuery();
Console.WriteLine("IsSiteAdmin: {0}", user.IsSiteAdmin);
}
PS. Another option - grant Full Control for user in Wep Appliction\User Policy (you need to have access to Central Administration).