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

Get-UserAndGroupMapping

Get-UserAndGroupMappingのPowerShellコマンドレットリファレンス。

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

コマンド

Get-UserAndGroupMapping

説明

移行元サイトと移行先サイトからユーザーとグループのマッピングを取得するコマンドです。

移行元サイトと移行先サイトからマッピングを取得する

# Connect to the source and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Retrieve and display the current user and group mapping settings
$mappingSettings = Get-UserAndGroupMapping -SourceSite $srcSite -DestinationSite $dstSite
$mappingSettings

# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings : CustomPermissions Members -> Sales&Marketing Owners
# i:0#.w|office\sg.achille -> i:0#.w|office\sg.baptiste
# i:0#.w|office\sg.camille -> i:0#.w|office\sg.denis
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :

ファイルシステムと移行先サイトからマッピングを取得する

# Connect to the destination site
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Retrieve user and group mappings from the file system, applying them to the destination site
$mappingSettings = Get-UserAndGroupMapping -FromFileSystem -DestinationSite $dstSite

# Display the retrieved mapping settings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings : OFFICE\Employee -> Sales&Marketing Owners
# OFFICE\sg.achille -> i:0#.w|office\sg.baptiste
# OFFICE\sg.camille -> i:0#.w|office\sg.denis
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :

移行元サイトと移行先サイトのマッピングとマージする

# Set up the user and group mapping
$mappingSettings = Set-UserAndGroupMapping -Source "John Doe" -Destination "Paul Smith"

# Update the mapping to include "myusername" -> "anotherusername"
$mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -Source "myusername" -Destination "anotherusername"

# Map unresolved users or groups to "Old employee Group"
$mappingSettings = Set-UserAndGroupMapping -MappingSettings $mappingSettings -UnresolvedUserOrGroup -Destination "Old employee Group"

# Connect to source and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Retrieve the updated user and group mapping with site context
$mappingSettings = Get-UserAndGroupMapping -MappingSettings $mappingSettings -SourceSite $srcSite -DestinationSite $dstSite

# Display the final mapping settings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings : <Unresolved users or groups> -> Old employee Group
# CustomPermissions Members -> Sales&Marketing Owners
# i:0#.w|office\sg.achille -> i:0#.w|office\sg.baptiste
# i:0#.w|office\sg.camille -> i:0#.w|office\sg.denis
# John Doe -> Paul Smith
# myusername -> anotherusername
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :

構文

Get-UserAndGroupMapping
-SourceSite <Site>
-DestinationSite <Site>
[-MappingSettings <MappingSettings>]
Get-UserAndGroupMapping
-FromFileSystem <SwitchParameter>
-DestinationSite <Site>
[-MappingSettings <MappingSettings>]

パラメーター

-DestinationSite <Site>

移行先のサイトを指定します。

必須かどうか

True

既定値

None

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

False

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

False

パラメーターセット名

(All)

エイリアス

None

-FromFileSystem <SwitchParameter>

移行元がファイルシステムであることを指定します。

必須かどうか

True

既定値

None

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

False

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

False

パラメーターセット名

FileSystem

エイリアス

None

-MappingSettings <MappingSettings>

マッピング設定を指定します。

必須かどうか

False

既定値

None

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

True (ByValue, ByPropertyName)

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

False

パラメーターセット名

(All)

エイリアス

None

-SourceSite <Site>

移行元のサイトを指定します。

必須かどうか

True

既定値

None

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

False

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

False

パラメーターセット名

Default

エイリアス

None

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

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