メインコンテンツにスキップ

Add-SiteCollectionAdministrator

注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。

コマンド

Add-SiteCollectionAdministrator

説明

このコマンドは、サイトに接続する際に、ユーザーアカウントにサイト コレクション管理者の権限を自動的に追加します。

注:

サイトにサイト コレクション管理者の権限を追加する

# Connect to the SharePoint site using the specified URL
$site = Connect-Site -Url "http://myfarm1/sites/mysite"
# Add a Site Collection Administrator to the specified SharePoint site
Add-SiteCollectionAdministrator -Site $site

サーバーの全体管理からサイトにサイト コレクション管理者の権限を追加する

# Connect to the SharePoint Central Administration site
$centralAdminSite = Connect-Site -Url "http://myfarm1:5000"

# Add a Site Collection Administrator to the specified SharePoint site
Add-SiteCollectionAdministrator -CentralAdmin $centralAdminSite -SiteUrl "http://myfarm1/sites/mysite/"

テナントからサイトにサイト コレクション管理者の権限を追加する

# Connect to the tenant using the specified domain and browser
$tenant = Connect-Tenant -Domain "mytenant" -Browser

# Add a Site Collection Administrator to the SharePoint site
Add-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl "https://mytenant.sharepoint.com/sites/mysite/"

OneDrive for Businessをプロビジョニングしてデータを取り込む

# Connect to the SharePoint admin site using browser authentication
$tenant = Connect-Site -Url "https://mytenant-admin.sharepoint.com" -Browser

# Get the OneDrive URL for the specified user, provisioning it if it doesn't exist
$oneDriveUrl = Get-OneDriveUrl -Tenant $tenant -Email "[email protected]" -ProvisionIfRequired

# Add a site collection administrator for the user's OneDrive
Add-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl $oneDriveUrl

# Connect to the user's OneDrive using stored credentials
$oneDrive = Connect-Site -Url $oneDriveUrl -UseCredentialsFrom $tenant

# Get the "Documents" list from the OneDrive site
$dstList = Get-List -Name "Documents" -Site $oneDrive

# Import documents from a shared network drive to the OneDrive "Documents" list
Import-Document -SourceFolder "\\mysharedrive\documentsToImport\" -DestinationList $dstList

# Remove the site collection administrator from the user's OneDrive
Remove-SiteCollectionAdministrator -CentralAdmin $tenant.Site -SiteUrl $oneDriveUrl

構文

Add-SiteCollectionAdministrator
-Site <Site>

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

パラメーター

-CentralAdmin <Site>

変換対象のファームまたはテナントのサイトを指定します。

必須かどうか

True

既定値

None

パイプライン入力を許可するか

True (ByValue, ByPropertyName)

ワイルドカード文字を許可するか

False

パラメーターセット名

CentralAdmin

エイリアス

None

-Site <Site>

変換対象のサイトを指定します。

必須かどうか

True

既定値

None

パイプライン入力を許可するか

True (ByValue, ByPropertyName)

ワイルドカード文字を許可するか

False

パラメーターセット名

(All)

エイリアス

None

-SiteUrl <String>

変換対象のサイトを指定します。

必須かどうか

True

既定値

None

パイプライン入力を許可するか

True (ByValue, ByPropertyName)

ワイルドカード文字を許可するか

False

パラメーターセット名

CentralAdmin

エイリアス

None

この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。

こちらの回答で解決しましたか?