注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。
コマンド
Save-ContentTypeMapping
説明
特定の移行元リストと移行先リストに対するすべてのコンテンツ タイプ マッピングを保存するコマンドです。
例
移行元リストと移行先リストのカスタム マッピングを保存する
# Connect to the source and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
# Retrieve the source list from the source site
$srcList = Get-List -Name mysrclist -Site $srcSite
# Retrieve the destination list from the destination site
$dstList = Get-List -Name mydstlist -Site $dstSite
# Retrieve existing content type mappings between the source and destination lists
$mappingSettings = Get-ContentTypeMapping -SourceList $srcList -DestinationList $dstList
# Display the retrieved content type mappings
$mappingSettings
# Example initial output:
# PropertyMappings :
# ContentTypeMappings : Audio -> Audio
# Basic Page -> <NO DESTINATION>
# Document -> Document
# Folder -> Folder
# Image -> <NO DESTINATION>
# Video -> <NO DESTINATION>
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :
# Add a content type mapping from "Image" to "Picture"
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source Image -Destination Picture
# Add a content type mapping from "Video" to "Movie"
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source Video -Destination Movie
# Add a content type mapping for "My Custom Content Type" to ignore its destination
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "My Custom Content Type" -Ignore
# Save the updated content type mappings to the source and destination lists
$mappingSettings = Save-ContentTypeMapping -SourceList $srcList -DestinationList $dstList -MappingSettings $mappingSettings
# Retrieve the updated content type mappings to confirm changes
$mappingSettings = Get-ContentTypeMapping -SourceList $srcList -DestinationList $dstList
# Display the updated content type mappings
$mappingSettings
# Example updated output:
# PropertyMappings :
# ContentTypeMappings : Audio -> Audio
# Basic Page -> <NO DESTINATION>
# Document -> Document
# Folder -> Folder
# Image -> Picture
# My Custom Content Type -> <NO DESTINATION>
# Video -> Movie
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :
ファイルシステムと移行先リストのカスタム マッピングを保存する
# Connect to the destination site
$dstSite = Connect-Site -Url http://myfarm1/sites/mydestinationsite
# Retrieve the destination list from the destination site
$dstList = Get-List -Name mydstlist -Site $dstSite
# Retrieve existing content type mappings from the file system for the destination list
$mappingSettings = Get-ContentTypeMapping -FromFileSystem -DestinationList $dstList
# Display the retrieved content type mappings
$mappingSettings
# Example initial output:
# PropertyMappings :
# ContentTypeMappings : <File> -> Document
# <Folder> -> Folder
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :
# Update the content type mapping for files from the file system to map to "Picture"
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -FileFromFileSystem -Destination Picture
# Update the content type mapping for folders from the file system to map to "Document Set"
$mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -FolderFromFileSystem -Destination "Document Set"
# Save the updated content type mappings back to the destination list
$mappingSettings = Save-ContentTypeMapping -FromFileSystem -DestinationList $dstList -MappingSettings $mappingSettings
# Retrieve the updated content type mappings to confirm changes
$mappingSettings = Get-ContentTypeMapping -FromFileSystem -DestinationList $dstList
# Display the updated content type mappings
$mappingSettings
# Example updated output:
# PropertyMappings :
# ContentTypeMappings : <File> -> Picture
# <Folder> -> Document Set
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# SensitivityLabelMappings :
構文
Save-ContentTypeMapping
-MappingSettings <MappingSettings>
-SourceList <List>
-DestinationList <List>
Save-ContentTypeMapping
-MappingSettings <MappingSettings>
-FromFileSystem <SwitchParameter>
-DestinationList <List>
パラメーター
-DestinationList <List>
移行先リストを指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-FromFileSystem <SwitchParameter>
移行元がファイルシステムであることを指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | FileSystem |
エイリアス | None |
-MappingSettings <MappingSettings>
マッピング設定を指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | True (ByValue, ByPropertyName) |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-SourceList <List>
移行元リストを指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | Default |
エイリアス | None |
この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。
