SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for some help removing a User Permission from a site using PowerShell.

share|improve this question
Thanks for the replies. My apologies for not realizing this question was never marked answered. To clarify the question: I was referring to removing a "User Permission" not an SPUser object from the site. – ChiliYago May 13 '13 at 17:55
Do mean in the sense of "Contribute", "Read" etc.... – BlueBird Jul 31 '13 at 12:34
remove the user from the site this seems to remove the users from any groups, webs, and list and item permissions! – user21509 Dec 18 '13 at 22:52
up vote 3 down vote accepted

To remove site permissions for a user, you will have to remove the user from the group to which the user has been given permission to. Sample code would look like this -

$site = new-object Microsoft.SharePoint.SPSite("Site URL") 
$web = $site.OpenWeb() 
$oSiteGroup = $web.SiteGroups["Group Name"];
$oUsers = $oSiteGroup.Users
foreach ($oUser in $oUsers) 
    "Removing user : " + $oUser.Name 

If the user is given permission directly without being added in a gorup, rewrite the above code, search within $web.users instead of $oSiteGroup.Users and it should work.

Good Luck .

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.