0

I know how to delete permissions from lists and document libraries. Simply I can use the BreakRoleInheritance, and I can remove every user. But I couldn't find a way to do this with a site.

Like this: $site =new-object Microsoft.SharePoint.SPSite (http://spt/spaces/thisisit)

$site doesn't have inheritance method (or I just don't know how to use it).

So how can I delete every permission on a site? Not on the lists, not on the document libraries, but on the site itself?

0

You need to get the web object of the site to break the inheritance:

$web = Get-SPWeb -Identity $Url
$web.BreakRoleInheritance($True)

UPDATE

If you want to delete permission levels in root web, you can do it this way:

$web = Get-SPWeb -Identity http://sp2010:90
$PermissionLevel=$web.RoleDefinitions
$PermissionLevel.Delete("Contribute")
  • This seems to be the way. But i got an error: "Cannot change permissions of root web: I am the owner with full control. Why can't i modify it? – Lokids Aug 27 '13 at 12:50
  • The error is obvious, you break inheritance for child webs not root web. Rootweb doesn't inherit from anything. – Nadeem Yousuf Aug 27 '13 at 12:57
  • Hmmm. I thought the stp is the root web. But the "thisisit" is also root? Because then i have an another problem. How can i delete every user on root web? – Lokids Aug 27 '13 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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