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?

1

1 Answer 1

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")
3
  • 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? Commented Aug 27, 2013 at 12:50
  • The error is obvious, you break inheritance for child webs not root web. Rootweb doesn't inherit from anything. Commented Aug 27, 2013 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? Commented Aug 27, 2013 at 13:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.