0

I have a minor problem which nevertheless requires some smarts to approach in a time efficient manner. In a given SharePoint 2010 Farm one power user has created a number of site collections (>50) containing important information. No one else has access. I need to go through and:

  1. Identify which site collections this power user owns.
  2. Assign ownership or full control to another existing user.

Is there a quick way to do this or is it just going to be through hard slog?

1

You could use Powershell to do that. A quick search revealed this, found here:

# This script will add a named Site Collection Administrator
# to all Site Collections within a Web Application.
#
######################## Start Variables ########################
$newSiteCollectionAdminLoginName = "domain\user"
$newSiteCollectionAdminEmail = "email@saltypc.com"
$newSiteCollectionAdminName = "Eric Kirkpatrick"
$newSiteCollectionAdminNotes = ""
$siteURL = "https://yourwebapplication" #Web Application URL
$add = 1 # 1 for adding this user, 0 to remove this user
######################## End Variables ########################
Clear-Host
$siteCount = 0
[system.reflection.assembly]::loadwithpartialname("Microsoft.SharePoint")
$site = new-object microsoft.sharepoint.spsite($siteURL)
$webApp = $site.webapplication
$allSites = $webApp.sites
######################## Write Progress Declaration ######################## 
$i = 0
foreach ($site in $allSites)
{
    $web = $site.openweb()
    $web.allusers.add($newSiteCollectionAdminLoginName, $newSiteCollectionAdminEmail, $newSiteCollectionAdminName, $newSiteCollectionAdminNotes)

    $user = $web.allUsers[$newSiteCollectionAdminLoginName]
    $user.IsSiteAdmin = $add
    $user.Update()
    $web.Dispose()
    $siteCount++

######################## Update Counter and Write Progress ########################
   $i++
   Write-Progress -Activity "Adding $newSiteCollectionAdminName to all site collections within $siteURL.  Please wait..." -status "Added: $i of $($allSites.Count)" -percentComplete (($i / $allSites.Count)  * 100)
}
$site.dispose()
write-host "Updated" $siteCount "Site Collections."

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.