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

  • 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, 2013 at 17:55
  • Do mean in the sense of "Contribute", "Read" etc....
    – BlueBird
    Jul 31, 2013 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, 2013 at 22:52

2 Answers 2


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 .


Have a look here for an example


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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