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

Import-UserAndGroupMapping

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

コマンド

Import-UserAndGroupMapping

説明

ユーザーとグループのマッピングをファイルからインポートするコマンドです。

ユーザーとグループのマッピングの詳細や、ShareGateのユーザー マッピング ファイル(SGUM)をエクスポートおよびインポートする方法については、ユーザーとグループをマッピングするを参照してください。

ファイルからマッピングをインポートする

# Import the user and group mapping from the specified file
$mappingSettings = Import-UserAndGroupMapping -Path "C:\MyMappings\MyUserAndGroupMappingsFileName.sgum"

# Display the imported mapping settings
$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 :

ファイルのマッピングとマージする

# Create and update user and group mappings
$mappingSettings = Set-UserAndGroupMapping -Source "John Doe" -Destination "Paul Smith"

$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"

# Import additional mappings from the specified file, merging with the current settings
$mappingSettings = Import-UserAndGroupMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyUserAndGroupMappingsFileName.sgum"

# 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 :

構文

Import-UserAndGroupMapping-Path <String> [-MappingSettings <MappingSettings>]

パラメーター

-MappingSettings <MappingSettings>

マッピング設定を指定します。このコマンドを使用すると、既存のマッピング設定オブジェクトに複数のマッピング設定を追加できます。詳細については、複数のマッピング ファイルを同時に使用するを参照してください。

必須かどうか

False

既定値

None

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

True (ByValue, ByPropertyName)

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

False

パラメーターセット名

(All)

エイリアス

None

-Path <String>

以前にShareGateからエクスポートしたファイル パスを指定します。

必須かどうか

True

既定値

None

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

False

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

False

パラメーターセット名

(All)

エイリアス

PSPath

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

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