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

Import-UserAndGroupMapping

PowerShell を使用して、SGUM ファイルからユーザーとグループのマッピングをインポートします。

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

Command

Import-UserAndGroupMapping

Description

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

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

Examples

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

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

Syntax

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

Parameters

-MappingSettings <MappingSettings>

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

必須

False

既定値

なし

パイプライン入力を受け付けますか?

True (ByValue, ByPropertyName)

ワイルドカード文字を受け付けますか?

False

パラメーター セット名

(All)

エイリアス

なし

-Path <String>

ShareGate で以前にエクスポートされたファイルのパスを指定します。

必須

True

既定値

なし

パイプライン入力を受け付けますか?

False

ワイルドカード文字を受け付けますか?

False

パラメーター セット名

(All)

エイリアス

PSPath

この記事は人工知能を使用して翻訳されました。疑問がある場合は、元の英語版をご確認ください。

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