SharePoint 2010

Alister Thornley 1 Reputation point
2020-07-21T19:31:47.107+00:00

Hi All,

Looking for expert opinions on this script I have written. The intention is to deny access to sites identified as not being used, in preparation for a migration from SharePoint 2010 to SharePoint Online. Have I missed anything?

I have skipped removing the limited access permissions, because I am not really sure what they are there for... Are they required system permissions?

Also,
I am a bit concerned about this line:
$spweb.hasuniqueroleassignments -eq "True"
should it actually be:
$spweb.hasuniqueroleassignments -eq $True

Had to rename my PS1 to TXT, I guess it is deemed dangerous

13178-removepermissions3.txt

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
1,468 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Somenath Ghosh 1 Reputation point
    2020-07-21T20:24:43.277+00:00

    $spweb.hasuniqueroleassignments will return $true not "True"

    No comments

  2. ChelseaWu-MSFT 6,241 Reputation points
    2020-07-22T02:05:48.173+00:00
    1. The Limited Access permission is automatically assigned by SharePoint when you provide access to one specific item. You cannot assign Limited Access permissions directly to a user or group yourself, but it is safe to remove this permission from a user or group.
    2. The value returned by SPWeb.HasUniqueRoleAssignments Property is True/False in SharePoint Server 2013 or higher version, but $True/$False in SharePoint Server 2010.
    No comments