Skip to main content
All CollectionsMigratePowerShellGeneral
Add Site Collection Administrator
Add Site Collection Administrator
Updated this week

Command

Add-SiteCollectionAdministrator

Description

This command automatically adds site collection administrator rights to your user account when you connect to a site.

Notes:

Index

Examples

Add Site Collection Administrator rights on site

$site = Connect-Site -Url "http://myfarm1/sites/mysite"
Add-SiteCollectionAdministrator -Site $site

Add Site Collection Administrator rights on site from the central administration

$centralAdminSite = Connect-Site -Url http://myfarm1:5000/Add-SiteCollectionAdministrator -CentralAdmin $centralAdminSite -SiteUrl http://myfarm1/sites/mysite/

Add Site Collection Administrator rights on site from a tenant

$tenant = Connect-Tenant -Domain mytenant -BrowserAdd-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl https://mytenant.sharepoint.com/sites/mysite/

Provision and populate One Drive for Business

$tenant= Connect-Site -Url https://mytenant-admin.sharepoint.com -Browser$oneDriveUrl = Get-OneDriveUrl -Tenant $tenant -Email [email protected] -ProvisionIfRequiredAdd-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl $oneDriveUrl$oneDrive = Connect-Site -Url $oneDriveUrl -UseCredentialsFrom $tenant$dstList = Get-List -Name Documents -Site $oneDriveImport-Document -SourceFolder \\mysharedrive\documentsToImport\ -DestinationList $dstListRemove-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl $oneDriveUrl

Syntax

Add-SiteCollectionAdministrator-Site <Site>
Add-SiteCollectionAdministrator-CentralAdmin <Site>
-SiteUrl <String>

Parameters

-CentralAdmin <Site>

Specifies the farm or tenant site for the transform.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

CentralAdmin

Aliases

None

-Site <Site>

Specifies the site to transform.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-SiteUrl <String>

Specifies the site to transform.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

CentralAdmin

Aliases

None

Did this answer your question?