共用方式為


MDT Windows PowerShell Cmdlet

除了 Deployment Workbench 之外,還可以使用 Windows PowerShell Cmdlet 來管理 MDT 部署共用。 MDT Windows PowerShell Cmdlet 包含在 Windows PowerShell 嵌入式管理單元中,Microsoft.BDD.PSSnapIn— 隨附於 MDT 的安裝中。

MDT Cmdlet 必須從已載入 MDT Windows PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行。 For more information on how to start a Windows PowerShell console that has the MDT Windows PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

表 7 列出 MDT Windows PowerShell Cmdlet,並提供每個 Cmdlet 的簡短描述。 後續章節會進一步詳細討論每個 Cmdlet。

表格 7 MDT Windows PowerShell Cmdlet

指令程式 描述
Add-MDTPersistentDrive 將部署共用新增至可使用 Restore-MDTPersistentDrive Cmdlet 還原的 MDT 保存磁碟驅動器清單。
Disable-MDTMonitorService 停用 MDT 監視服務。
Enable-MDTMonitorService 啟用 MDT 監視服務。
Get-MDTDeploymentShareStatistics 顯示部署共用的統計數據,包括部署共用中每個主要資料夾的實體數目。
Get-MDTMonitorData 顯示針對一或多個受監視的 MTD 部署所收集的 MDT 監視資訊。
Get-MDTOperatingSystemCatalog 傳回特定作業系統的作業系統目錄。 如果作業系統目錄不存在或已過期,則會重新產生作業系統目錄。
Get-MDTPersistentDrive 顯示可使用 Restore-MDTPersistentDrive Cmdlet 還原的部署共享清單。
Import-MDTApplication 將應用程式匯入部署共用。
Import-MDTDriver 將一或多個設備驅動器匯入部署共用。
Import-MDTOperatingSystem 將一或多個作業系統匯入部署共用。
Import-MDTPackage 將一或多個作業系統套件匯入部署共用。
Import-MDTTaskSequence 將工作順序匯入部署共用。
New-MDTDatabase 建立或升級與部署共用相關聯的 MDT DB 資料庫。
Remove-MDTMonitorData 從部署共用中收集的 MDT 監視數據中移除一或多個 MDT 監視數據項。
Remove-MDTPersistentDrive 從可使用 Restore-MDTPersistentDrive Cmdlet 還原的 MDT 保存 Windows PowerShell 磁碟驅動器清單中移除部署共用。
Restore-MDTPersistentDrive 在 MDT 保存的 Windows PowerShell 磁碟驅動器清單中,為每個部署共用建立 Windows PowerShell 磁碟驅動器。
Set-MDTMonitorData 在部署共用中收集的 MDT 監視數據中,建立新的或更新現有的 MDT 監視數據項。
Test-MDTDeploymentShare 驗證部署共用的完整性。
Test-MDTMonitorData 確認 MDT 監視服務已正確設定並執行。
Update-MDTDatabaseSchema 更新 MDT DB 資料庫架構。
Update-MDTDeploymentShare 更新部署共用。
Update-MDTLinkedDS 將內容從部署共用復寫至連結的部署共用。
Update-MDTMedia 將內容從部署共用復寫至部署媒體資料夾。

Add-MDTPersistentDrive

本節說明 Add-MDTPersistentDriveWindows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Add-MDTPersistentDrive [-Name] <String> [[-InputObject] <PSObject>] [<CommonParameters>]

描述

此 Cmdlet 會使用 MDTProvider 建立的現有 Windows PowerShell 磁碟驅動器,新增至使用 Restore-MDTPersistentDrive Cmdlet 保存在 Deployment Workbench 或 Windows PowerShell 會話中的磁碟驅動器清單。 當您在 Deployment Workbench 中建立或開啟部署共用時,會呼叫此 Cmdlet。

注意事項

保存的 MDTProvider 磁碟驅動器清單會根據使用者配置檔中的每個用戶來維護。

您可以使用 Get-MDTPersistentDrive Cmdlet 來顯示儲存的 MDTProvider 磁碟驅動器清單。

參數

本小節提供可與 Add-MDTPersistentDriveWindows Cmdlet 搭配使用的各種參數相關信息。

-Name <字串>

指定使用 MDT 提供者建立且對應至現有部署共用的 Windows PowerShell 磁碟驅動器名稱。 名稱是使用 New-PSDrive Cmdlet 建立,並在 PSProvider 參數中指定 MDTProvider

For more information on how to create a new Windows PowerShell drive using the MDTProvider and how to create a deployment share using Windows PowerShell, see the section "Creating a Deployment Share Using Windows PowerShell" in the MDT document, Microsoft Deployment Toolkit Samples Guide.

參數
Required? True
位置? 2具名
預設值
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-InputObject <PSObject>

此參數會指定稍早在程式中建立的 Windows PowerShell 磁碟驅動器物件。 輸入 PSObject 物件,例如 New-PSDrive Cmdlet 所產生的物件。

參數
Required? False
位置? 3具名
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出 Windows PowerShell 磁碟驅動器物件的 PSObject 類型物件已新增至保存的磁碟驅動器清單。

如果包含 Verbose 通用參數,此 Cmdlet 也會輸出 String 類型物件。

範例 1

Add-MDTPersistentDrive -Name DS001

描述

本範例會將具有 Windows PowerShell 磁碟驅動器名稱 DS001 的部署共用新增至保存的磁碟驅動器清單。

範例 2

$MDTPSDrive = New-PSDrive -Name "DS001" -PSProvider "MDTProvider" -Root "C:\DeploymentShare$" -Description "MDT Deployment Share" -NetworkPath \\WDG-MDT-01\DeploymentShare$ -Verbose
Add-MDTPersistentDrive -InputObject $MDTPSDrive

描述

本範例會使用 $MDTPSDrive 變數,將 New-PSDrive Cmdlet 所建立的 Windows PowerShell 磁碟驅動器名稱 DS001 新增至保存的 MDT 磁碟驅動器清單。

範例 3

New-PSDrive -Name "DS001" -PSProvider "MDTProvider" -Root "C:\DeploymentShare$" -Description "MDT Deployment Share" -NetworkPath \\WDG-MDT-01\DeploymentShare$ -Verbose | Add-MDTPersistentDrive -Verbose

描述

本範例會將 New-PSDrive Cmdlet 所建立的 Windows PowerShell 磁盤驅動器名稱 DS001 新增至保存的 MDT 磁碟驅動器列表,方法是將新建立的 Windows PowerShell 磁碟驅動器物件管線傳送至 Add-MDTPersistentDrive Cmdlet。

Disable-MDTMonitorService

本節說明 Disable-MDTMonitorService Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Disable-MDTMonitorService [<CommonParameters>]

描述

此 Cmdlet 會停用 MDT 監視服務,該服務會在安裝 MDT 的電腦上執行。 MDT 監控服務會收集可顯示的監視資訊:

參數

本小節提供可與 Disable-MDTMonitorService Cmdlet 搭配使用的各種參數相關信息。

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 會輸出 String 類型物件;否則,不會產生任何輸出。

範例 1

Disable-MDTMonitorService

描述

此範例會停用 MDT 監視服務。

Enable-MDTMonitorService

本節說明 Enable-MDTMonitorService Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Enable-MDTMonitorService [-EventPort] <Int32> [-DataPort] <Int32> [<CommonParameters>]

描述

此 Cmdlet 會啟用 MDT 監視服務,該服務會在安裝 MDT 的電腦上執行。 MDT 監控服務會收集可顯示的監視資訊:

參數

本小節提供可與 Enable-MDTMonitorService Cmdlet 搭配使用的各種參數相關信息。

-EventPort <Int32>

此參數會指定用來作為 MDT 監視服務之事件埠的 TCP 連接埠。

參數
Required? False
位置? 2具名
預設值 9800
接受管線輸入嗎? False
接受通配符嗎? False

-DataPort <Int32>

此參數會指定用來作為 MDT 監視服務資料埠的 TCP 連接埠。

參數
Required? False
位置? 3具名
預設值 9801
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 會輸出 String 類型物件;否則,不會產生任何輸出。

範例 1

Enable-MDTMonitorService

描述

此範例會使用事件埠的預設值 9800 ,以及 MDT 監視服務上數據埠的值 9801 ,在本機電腦上啟用 MDT 監視服務。

範例 2

Enable-MDTMonitorService -EventPort 7000 -DataPort 7001

描述

此範例會使用事件埠的 值 7000 ,以及 MDT 監視服務上數據埠的值 7001 ,在本機電腦上啟用 MDT 監視服務。

Get-MDTDeploymentShareStatistics

本節說明 Get-MDTDeploymentShareStatistics Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Get-MDTDeploymentShareStatistics [-Path <String>] [<CommonParameters>]

描述

此 Cmdlet 會根據 Path 參數中指定的 MDTProvder 磁碟驅動器,顯示部署共用的統計數據。 統計資料包括指定部署共用中的項目數:

  • 應用程式

  • 司機

  • 作業系統

  • 套件

  • 工作順序

  • 選取配置檔

  • 連結的部署共用

  • MDT 媒體

  • MDT DB 中的電腦

  • MDT DB 中的 Make 和 Models

  • MDT DB 中的位置

  • MDT DB 中的角色

注意事項

不會填入與 MDT DB 相關的統計數據值,而且一律會傳回零的值。

參數

本小節提供可與 Get-MDTDeploymentShareStatistics Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定所需部署共用的 MDTProvider Windows PowerShell 磁碟驅動器。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為所需 MDTProvider Windows PowerShell 磁碟驅動器內的位置。

參數
Required? False
位置? 2具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出 PSObject 類型物件,其中包含部署共用的統計數據。

範例 1

Get-MDTDeploymentShareStatistics -Path DS001:

描述

此範例會傳回 DS001: MDTProvider Windows PowerShell 磁盤驅動器中指定之部署共用的部署共用統計數據。

範例 2

cd DS001:
Get-MDTDeploymentShareStatistics

描述

此範例會傳回 DS001: MDTProvider Windows PowerShell 磁盤驅動器中指定之部署共用的部署共用統計數據。 使用 cd 命令將 Windows PowerShell 的工作目錄設定為 DS001:MDTProvider Windows PowerShell 磁碟驅動器。

Get-MDTMonitorData

本節說明 Get-MDTMonitorData Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Get-MDTMonitorData [-Path <String>] [-ID <Nullable>] [<CommonParameters>]

描述

此 Cmdlet 會顯示要回報給 Path 參數中指定之部署共用的 MDT 監視數據。 以下是此 Cmdlet 的範例輸出:

Name               : WDG-REF-01
PercentComplete    : 100
Settings           :
Warnings           : 0
Errors             : 0
DeploymentStatus   : 3
StartTime          : 5/23/2012 6:45:39 PM
EndTime            : 5/23/2012 8:46:32 PM
ID                 : 1
UniqueID           : 94a0830e-f2bb-421c-b1e0-6f86f9eb9fa1
CurrentStep        : 88
TotalSteps         : 88
StepName           :
LastTime           : 5/23/2012 8:46:32 PM
DartIP             :
DartPort           :
DartTicket         :
VMHost             : WDG-HOST-01
VMName             : WDG-REF-01
ComputerIdentities : {}

注意事項

執行此 Cmdlet 之前,此 Cmdlet 參考的 MDTProvider Windows PowerShell 磁碟驅動器必須存在。

參數

本小節提供可搭配 Get- MDTMonitorData Cmdlet 使用的各種參數相關信息。

-Path <字串>

此參數會指定所需部署共用的 MDTProvider Windows PowerShell 磁碟驅動器。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為所需 MDTProvider Windows PowerShell 磁碟驅動器內的位置。

參數
Required? False
位置? 2具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ID <可為 Null>

此參數會指定特定電腦部署的特定識別碼。 如果未指定此參數,則會顯示部署共用中部署的所有監視數據。

參數
Required? False
位置? 3具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出每部受監視電腦的 PSObject 類型物件,其中包含計算機的監視數據。

範例 1

Get-MDTMonitorData -Path DS001:

描述

此範例會傳回 DS001:MDTProvider Windows PowerShell 磁盤驅動器中指定之部署共用中所有部署的監視數據。

範例 2

cd DS001:
Get-MDTMonitorData

描述

此範例會傳回 DS001:MDTProvider Windows PowerShell 磁盤驅動器中指定之部署共用中所有部署的監視數據。 使用 cd 命令將 Windows PowerShell 的工作目錄設定為 DS001:MDTProvider Windows PowerShell 磁碟驅動器。

範例 3

Get-MDTMonitorData -Path DS001: -ID 22

描述

此範例會傳回在 DS001:MDTProvider Windows PowerShell 磁碟驅動器中指定之部署共用中標識碼為 22 的部署監視數據。

Get-MDTOperatingSystemCatalog

本節說明 Get-MDTOperatingSystemCatalog Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Get-MDTOperatingSystemCatalog [-ImageFile] <String> [-Index] <Int32> [<CommonParameters>]

描述

此 Cmdlet 會擷取或建立自定義作業系統映射的作業系統目錄,讓您可以使用 Windows 系統映像管理員 (WSIM) 來修改對應的 unattend.xml 檔。 如果沒有可用的作業系統目錄,或現有操作系統目錄無效或已過期,此 Cmdlet 將會產生新的操作系統目錄。

注意事項

產生新操作系統目錄的程式可能需要很長的時間,因為自定義操作系統映像必須在操作系統目錄建立完成之前掛接、檢查及取消掛接。

參數

本小節提供可與 Get-MDTOperatingSystemCatalog Cmdlet 搭配使用的各種參數相關信息。

-ImageFile <字串>

此參數會指定自定義操作系統映像檔 (.wim 檔案) 的完整路徑,包括自定義操作系統映像檔的名稱。

參數
Required? True
位置? 2具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Index <Int32>

此參數會指定作業系統映像檔 (.wim 檔案) 內所需作業系統映射的索引。

參數
Required? True
位置? 3具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出包含作業系統目錄路徑的 PSObject 類型物件。

範例 1

Get-MDTOperatingSystemCatalog -ImageFile "DS001:\Operating Systems\Windows 8\sources\install.wim" -Index 2

描述

此範例會傳回操作系統映射檔 DS001:\Operating Systems\Windows 8\sources\install.wim 中索引為 2 的操作系統映射操作系統目錄。

Get-MDTPersistentDrive

本節說明 Get-MDTPersistentDrive Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Get-MDTPersistentDrive [<CommonParameters>]

描述

此 Cmdlet 會顯示保存的 MDT Windows PowerShell 磁碟驅動器清單。 保存的 MDT Windows PowerShell 磁碟驅動器列表是使用 Add-MDTPersistentDriveRemove-MDTPersistentDrive Cmdlet 或 Deployment Workbench 來管理。

此 Cmdlet 的輸出包含下列資訊:

  • Windows PowerShell 磁碟驅動器名稱,例如 DS001

  • 目錄路徑,例如 \\WDG-MDT-01\DeploymentShare$

    保存的 MDT Windows PowerShell 磁碟驅動器類似於保存的網路驅動器機對應。

注意事項

此保存的 MDT Windows PowerShell 磁碟驅動器清單會以每個使用者為基礎來維護,並儲存在使用者配置檔中。

參數

本小節提供可與 Get- MDTPersistentDrive Cmdlet 搭配使用的各種參數相關信息。

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會針對每個 MDT 保存的磁碟驅動器輸出 PSObject 類型物件,此物件與 New-PSDrive Cmdlet 傳回的 PSObject 類型物件相同。

範例 1

Get-MDTPersistentDrive

描述

此範例會顯示 MDT 儲存磁碟驅動器的清單。

Import-MDTApplication

本節說明 Import-MDTApplication Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Import-MDTApplication [-Path <String>] -Name <String> ApplicationSourcePath <String> -DestinationFolder <String> [-Move] [<CommonParameters>]

-或-

Import-MDTApplication [-Path <String>] -Name <String> NoSource [<CommonParameters>]

-或-

Import-MDTApplication [-Path <String>] -Name <String> Bundle [<CommonParameters>]

描述

此 Cmdlet 會將應用程式匯入部署共用。 您可以使用此 Cmdlet 匯入下列應用程式類型:

  • 具有來源檔案的應用程式,使用 ApplicationSourcePathDestinationFolderMove 參數。 第一個語法範例說明如何針對這種類型的應用程式使用此 Cmdlet。

  • 沒有來源檔案的應用程式,或是使用 NoSource 參數位於其他網路共享資料夾的來源檔案。 第二個語法範例說明如何針對這種類型的應用程式使用此 Cmdlet。

  • 應用程式套件組合,用來使用 Bundle 參數將 一組相關的應用程式分組。 最後一個語法範例說明如何針對這種類型的應用程式使用此 Cmdlet。

參數

本小節提供可與 Import-MDTApplication Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定要匯入的應用程式將放置在部署共用內之現有資料夾的完整路徑。 如果使用 DestinationFolder 參數,則 DestinationFolder 參數中指定的資料夾會建立在此參數中指定的資料夾下方。 此參數用於此 Cmdlet 的所有語法使用方式。

注意事項

如果未提供此參數,Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Name <字串>

此參數會指定要新增至部署共用的應用程式名稱,而且在部署共用內必須是唯一的。 此參數用於此 Cmdlet 的所有語法使用方式。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ApplicationSourcePath <字串>

此參數會指定將匯入部署共用之應用程式的應用程式來源檔案完整路徑。 此參數僅適用於第一個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-DestinationFolder <字串>

此參數會指定部署共用中要匯入應用程式來源檔案的資料夾。 此資料夾會建立在 Path 參數中指定的資料夾下方。 此參數僅適用於第一個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Move [<SwitchParameter>]

此參數會指定是否應該將應用程式的原始程式檔移 (,而不是從應用程式來源檔案所在的資料夾複製) ,這是在 ApplicationSourcePath 參數中指定。

如果此參數為:

  • 指定,然後移動檔案,並刪除 ApplicationSourcePath 參數中所指定資料夾中的檔案

  • 未指定,然後複製檔案,並保留 ApplicationSourcePath 參數中所指定資料夾中的檔案

    此參數僅適用於第一個語法範例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-NoSource [<SwitchParameter>]

此參數指定要匯入的應用程式是沒有要複製來源檔案的應用程式。 使用此參數時,應用程式來源檔案為:

  • 在網路共享資料夾上,這是在應用程式安裝命令行或工作目錄組態設定中指定

  • 已存在於作業系統映像中

    這個參數只適用於第二個語法範例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-Bundle [<SwitchParameter>]

此參數會指定要匯入的應用程式是兩個或多個應用程式組合的應用程式。 此參數僅適用於最後一個語法範例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出參考剛匯入之應用程式的 PSObject 類型物件。

範例 1

Import-MDTApplication -Path "DS001:\Applications" -Name "Office 2010 Professional Plus 32-bit" ApplicationSourcePath "\\WDG-MDT-01\Source$\Office2010ProPlus\x86" DestinationFolder "Office2010ProPlusx86"

描述

本範例會從位於 \\WDG-MDT-01\Source$\Office2010ProPlus\x86 的網络共享資料夾匯入來源檔案的應用程式,並將來源檔案複製到部署共用內的 DS001:\Applications\Office2010ProPlusx86。 來源檔案會保留。

範例 2

Import-MDTApplication -Path "DS001:\Applications" -Name "Office 2010 Professional Plus 32-bit" ApplicationSourcePath "\\WDG-MDT-01\Source$\Office2010ProPlus\x86" DestinationFolder "Office2010ProPlusx86" -Move

描述

本範例會從位於 \\WDG-MDT-01\Source$\Office2010ProPlus\x86 的網络共享資料夾匯入來源檔案的應用程式,並將來源檔案移至部署共用內的 DS001:\Applications\Office2010ProPlusx86。 來源檔案會從位於 \\WDG-MDT-01\Source$\Office2010ProPlus\x86 的網络共享資料夾中移除。 應用程式名為 Office 2012 Professional Plus 32 位。

範例 3

Import-MDTApplication -Path "DS001:\Applications" -Name "Office 2010 Professional Plus 32-bit" NoSource

描述

此範例會匯入名為 Office 2012 Professional Plus 32 位 且沒有來源檔案的應用程式。

範例 4

Import-MDTApplication -Path "DS001:\Applications" -Name "Woodgrove Bank Core Applications" Bundle

描述

此範例會匯入名為 Woodgrove Bank Core Applications 的應用程式套件組合。

Import-MDTDriver

本節說明 Import-MDTDriver Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Import-MDTDriver [-Path <String>] -SourcePath <String[]> [ImportDuplicates] [<CommonParameters>]

描述

此 Cmdlet 會將一或多個設備驅動器匯入部署共用。 此 Cmdlet 會從 SourcePath 參數中指定的資料夾開始搜尋設備驅動器。 此 Cmdlet 會在該資料夾結構中找到多個設備驅動器。

參數

本小節提供可與 Import-MDTDriver Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定將要匯入的設備驅動器放在部署共用內之現有資料夾的完整路徑。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。 如果未提供 SourcePath 參數,則必須提供此參數。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SourcePath <String[ ]>

此參數會針對設備驅動器檔案所在的來源資料夾,在字串陣列中指定一或多個完整路徑。 從此參數中指定的資料夾開始,每個資料夾結構都會搜尋設備驅動器,包括資料夾結構中的所有子資料夾和 .cab 檔案的內容。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為設備驅動器檔案所在的資料夾。 如果未提供 Path 參數,則必須提供此參數。

參數
Required? True
位置? 1具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ImportDuplicates [<SwitchParameter>]

此參數會指定此 Cmdlet 是否應該匯入重複的設備驅動器。 根據預設,不會匯入重複的設備驅動器。 藉由計算機資料夾中所有檔案的哈希值,偵測到重複的設備驅動器。 如果計算出的哈希值符合另一個設備驅動器,則要匯入的設備驅動器會被視為重複的。

如果偵測到重複的驅動程式,但未提供此參數,則會新增設備驅動器並連結至原始的現有設備驅動器。

如果此參數為:

  • 指定,然後匯入重複的設備驅動器

  • 未指定,則設備驅動器將會新增並連結到原始的現有設備驅動器

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會針對每個匯入) 的設備驅動器,輸出一或多個 PSObject 類型物件 (一個。

範例 1

Import-MDTDriver -Path "DS001:\Out-of-Box Drivers" SourcePath "\\WDG-MDT-01\Source$\Drivers"

描述

本範例會匯入資料夾結構中的所有設備驅動器,其資料夾結構根目錄為 \\WDG-MDT-01\Source$\Drivers。 設備驅動器會儲存在部署共用中對應至 DS001:MDTProvder Windows PowerShell 磁碟驅動器的 [現成驅動程式] 資料夾中。 如果偵測到任何重複的設備驅動器,設備驅動器將會新增並連結到部署共用中原始的現有設備驅動器。

範例 2

$DriverSourcePath="\\WDG-MDT-01\Source$\VendorADrivers", "\\WDG-MDT-01\Source$\VendorBDrivers"
Import-MDTDriver -Path "DS001:\Out-of-Box Drivers" SourcePath $DriverSourcePath ImportDuplicates

描述

本範例會匯入字串數位$DriverSourcePath中指定之資料夾結構中的所有設備驅動器。 設備驅動器會儲存在部署共用中對應至 DS001:MDTProvder Windows PowerShell 磁碟驅動器的 [現成驅動程式] 資料夾中。 如果偵測到任何重複的設備驅動器,則會匯入重複的設備驅動器。

Import-MDTOperatingSystem

本節說明 Import-MDTOperatingSystem Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Import-MDTOperatingSystem [-Path <String>] -SourcePath <String> [-DestinationFolder <String>] [-Move] [<CommonParameters>]

-或-

Import-MDTOperatingSystem [-Path <String>] [DestinationFolder <String>] -SourceFile <String> [SetupPath <String>] [-Move] [<CommonParameters>]

-或-

Import-MDTOperatingSystem [-Path <String>] -WDSServer <String> [<CommonParameters>]

描述

此 Cmdlet 會將操作系統匯入部署共用。 您可以使用此 Cmdlet 匯入下列作業系統類型:

  • 使用 SourcePath 參數,從原始來源檔案作業系統。 第一個語法範例說明如何針對這種類型的操作系統匯入使用此 Cmdlet。

  • 自定義操作系統映像檔,例如使用 SourceFile 參數從參照電腦擷取映像。 第二個語法範例說明如何針對這種類型的操作系統匯入使用此 Cmdlet。

  • 使用 WDSServer 參數出現在 Windows 部署服務中的作業系統映像。 最後一個語法範例說明如何針對這種類型的操作系統匯入使用此 Cmdlet。

參數

本小節提供可與 Import-MDTOperatingSystem Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定部署共用內現有資料夾的完整路徑,其中將放置要匯入的作業系統。 如果使用 DestinationFolder 參數,則 DestinationFolder 參數中指定的資料夾會建立在此參數中指定的資料夾下方。 此參數用於此 Cmdlet 的所有語法使用方式。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SourcePath <字串>

此參數會指定將匯入部署共用之操作系統的作業系統來源檔案的完整路徑。 此參數僅適用於第一個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-DestinationFolder <字串>

此參數會指定部署共用中要匯入作業系統來源檔案的資料夾。 此資料夾會建立在 Path 參數中指定的資料夾下方。 此參數僅適用於第一個和第二個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Move [<SwitchParameter>]

此參數會指定是否應該將操作系統來源檔案移 (,而不是從操作系統來源檔案所在的資料夾複製) ,這是在 DestinationFolder 參數中指定。

如果此參數為:

  • 指定,然後移動檔案,並刪除 DestinationFolder 參數中指定之資料夾中的檔案

  • 未指定,然後複製檔案,並保留 DestinationFolder 參數中所指定資料夾中的檔案

    此參數僅適用於第一個和第二個語法範例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SourceFile <字串>

此參數會針對將匯入部署共用的操作系統,指定作業系統來源 .wim 檔案的完整路徑。 這個參數只適用於第二個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SetupPath <字串>

此參數會指定需要匯入之操作系統安裝程式檔案的完整路徑,以及 SourceFile 參數中指定的 .wim 檔案。 這個參數只適用於第二個語法範例。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-WDSServer <字串>

此參數會指定要匯入作業系統映像檔所在的 Windows 部署服務伺服器名稱。 Windows 部署服務伺服器上的所有操作映像檔案都會匯入部署共用。 實際的操作系統映像檔不會複製到部署共用。 相反地,部署共用會包含 Windows 部署服務伺服器上每個作業系統檔案的連結。

此參數僅適用於最後一個語法範例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會針對) 匯入的每個作業系統,輸出一或多個 PSObject 類型物件 (一個。

範例 1

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" SourcePath "\\WDGMDT01\Source$\Windows8" DestinationFolder "Windows8x64"

描述

本範例會從位於 \\WDG-MDT-01\Source$\Windows8 的網络共用資料夾匯入操作系統,並將來源檔案複製到部署共用內的 DS001:\Operating Systems\Windows8x64。 來源檔案會保留。

範例 2

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" SourcePath "\\WDGMDT01\Source$\Windows8" DestinationFolder "Windows8x64" -Move

描述

本範例會從位於 \\WDG-MDT-01\Source$\Windows8 的網络共用資料夾匯入操作系統,並將來源檔案複製到部署共用內的 DS001:\Operating Systems\Windows8x64。 來源檔案會從位於 \\WDG-MDT-01\Source$\Windows8 的網络共享資料夾中移除。

範例 3

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" DestinationFolder "Windows8x64-Reference" -SourceFile "\\WDGMDT01\Capture$\WDG-REF-01_Capture.wim"

描述

本範例會從 \\WDG-MDT-01\ Capture$\WDG-REF-01_Capture.wim 匯入操作系統擷取的自定義映像檔 (.wim 檔案) ,並將映射檔案複製到部署共用內的 DS001:\Operating Systems\Windows8x64-Reference。 來源 .wim 檔案會保留在網路共享資料夾上。

範例 4

Import-MDTOperatingSystem -Path "DS001:\Operating Systems" WDSServer "WDG-WDS-01"

描述

此範例會從名為 WDG-WDS-01 的 Windows 部署服務伺服器匯入所有操作系統映射,並在部署共用內的 DS001:\Operating Systems 中建立每個操作系統映射的連結。 Windows 部署服務伺服器上的來源作業系統映像檔會保留在 Windows 部署服務伺服器上。

Import-MDTPackage

本節說明 Import-MDTPackage Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Import-MDTPackage [-Path <String>] [[-SourcePath] <String[]>] [<CommonParameters>]

描述

此 Cmdlet 會將一或多個作業系統套件匯入部署共用。 可匯入的作業系統套件類型包括安全性更新、語言套件或新元件。 Service Pack 不應匯入為操作系統套件,因為它們無法離線安裝。

參數

本小節提供可與 Import-MDTPackage Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定部署共用內現有資料夾的完整路徑,其中將放置要匯入的作業系統套件。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SourcePath <字串>

此參數會指定要掃描以供操作系統套件匯入之資料夾結構的完整路徑。 指定的資料夾結構將會掃描 .cab 和 .msu 檔案。 針對 .msu 檔案,系統會自動擷取 .msu 檔案內的 .cab 檔案。

參數
Required? True
位置? 1具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出參考剛匯入之套件的 PSObject 類型物件。

範例 1

Import-MDTOperatingSystem -Path "DS001:\Packages" SourcePath "\\WDGMDT01\Source$\OSPackages"

描述

此範例會掃描位於 \\WDG-MDT-01\Source$\OSPackages 的網络共享資料夾,以取得操作系統套件,並將來源檔案複製到部署共用內的 DS001:\Packages 資料夾。 來源檔案會從位於 \\WDG-MDT-01\Source$\OSPackages 的網络共享資料夾中移除。

Import-MDTTaskSequence

本節說明 Import-MDTTaskSequence Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Import-MDTTaskSequence [-Path <String>] -Template <String> -Name <String> -ID <String> [[-Comments] <String>] [[-Version] <String>] [-OperatingSystemPath <String>] [-OperatingSystem <PSObject>] [-FullName <String>] [-OrgName <String>] [-HomePage <String>] [-ProductKey <String>] [-OverrideProductKey <String>] [-AdminPassword <String>] [<CommonParameters>]

描述

此 Cmdlet 會將工作順序匯入部署共用。 新匯入的工作順序將會以 Template 屬性中指定的現有工作順序範本為基礎。

參數

本小節提供可與 Import-MDTPackage Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定部署共用內現有資料夾的完整路徑,以在其中放置要匯入的工作順序。 根據預設,路徑應該指向部署共用中 Control 資料夾或 Control 資料夾的子資料夾。 ID 參數的值將用來在這個參數中指定的路徑內建立子資料夾。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Template <String>

此參數會指定要用於匯入新工作順序的工作順序範本。 工作順序範本是 .xml 檔案,其中包含特定工作順序類型的工作順序步驟。 如果工作順序樣本位於:

  • installation_folder\Templates 資料夾 (,其中 installation_folder 是 MDT 安裝) 的資料夾,因此只需要 .xml 檔名。

  • 需要另一個資料夾,然後需要完整路徑,包括工作順序範本 .xml 的名稱。

    如需 MDT for LTI 部署隨附之工作順序範本的詳細資訊,請參閱 MDT 檔《 使用Microsoft部署工具組》中的一節。

參數
Required? True
位置? 1具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Name <字串>

此參數會指定要匯入的工作順序名稱。 此參數的值在部署共用內必須是唯一的。

參數
Required? True
位置? 2具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ID <字串>

此參數會指定要匯入之工作順序的標識碼。 此參數的值在部署共用內必須是唯一的。 指派給此參數的值應為大寫,且沒有任何空格或特殊字元。 這個值可用來在 Path 參數中指定的資料夾中建立子資料夾,該資料夾應該位於部署共用的[控制] 資料夾底下。

參數
Required? True
位置? 3具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Comments <字串>

此參數會指定文字,以提供有關要匯入之工作順序的其他描述性資訊。 此描述性信息會顯示在 Deployment Workbench 中。

參數
Required? False
位置? 4具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Version <String>

此參數會指定要匯入之工作順序的版本號碼。 此參數的值僅供資訊使用,且 MDT 不會用於版本相關處理。

參數
Required? False
位置? 4具名
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-OperatingSystemPath <字串>

此參數會指定部署共用中資料夾的完整 Windows PowerShell 路徑,其中包含要與此工作順序搭配使用的操作系統,例如 DS001:\Operating Systems\Windows 8。 操作系統必須已經存在於正在匯入工作順序的部署共用中。

注意事項

如果您未提供此參數,且工作順序需要參考操作系統,則必須提供 OperatingSystem 參數。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-OperatingSystem <PSObject>

此參數會指定要與此工作順序搭配使用的操作系統物件。 操作系統必須已經存在於正在匯入工作順序的部署共用中。

您可以使用 Get-Item Cmdlet 擷取作業系統的 Windows PowerShell 物件,例如下列範例:

$OS=Get-Item "DS001:\Operating Systems\Windows 8"

如需 Get-Item Cmdlet 的詳細資訊,請參閱 使用 Get-Item Cmdlet

注意事項

如果您未提供此參數,而且工作順序需要參考操作系統,則必須提供 OperatingSystemPath 參數。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-FullName <字串>

此參數會指定要與此工作順序搭配使用的操作系統已註冊擁有者的名稱。 此名稱會儲存在 RegisteredOwner 登入機碼 中,HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-OrgName <字串>

此參數會指定要與此工作順序搭配使用之作業系統的已註冊擁有者之組織名稱。 此名稱會儲存在 RegisteredOrganization 登入機碼 中的HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-HomePage <字串>

此參數會指定要當做 Internet Explorer 首頁使用的 URL。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ProductKey <字串>

此參數會指定要用於作業系統搭配此工作順序的產品金鑰。 此產品金鑰僅適用於 Windows 作業系統的零售版。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

注意事項

如果未提供此參數,則在部署精靈、CustomSettings.ini 檔案或 MDT DB 中部署此工作順序時,必須提供產品密鑰。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-OverrideProductKey <字串>

此參數會指定要用於操作系統的MAK金鑰,以搭配此工作順序使用。 此產品金鑰僅適用於大量授權版本的 Windows。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

注意事項

如果未提供此參數,則在部署精靈、CustomSettings.ini 檔案或 MDT DB 中部署此工作順序時,必須提供 MAK 金鑰。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-AdminPassword <String>

此參數會指定要指派給目標計算機上內建本機系統管理員帳戶的密碼。 這個參數的值會插入 Unattend.xml 檔案中,以與此工作順序相關聯。

注意事項

如果未提供此參數,則在部署精靈、CustomSettings.ini 檔案或 MDT DB 中部署此工作順序時,必須提供要指派給目標計算機上內建本機系統管理員帳戶的密碼。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出參考剛匯入之工作順序的 PSObject 類型物件。

範例 1

Import-MDTTaskSequence -Path "DS001:\Control" -Template "Client.xml" -Name "Deploy Windows 8 to Reference Computer" -ID "WIN8REFERENCE" -Comments "Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01)" -Version "1.00" -OperatingSystemPath "DS001:\Operating Systems\Windows 8_x64" -FullName "Woodgrove Bank Employee" -OrgName "Woodgrove Bank" HomePage "https://www.woodgrovebank.com"  OverrideProductKey "1234512345123451234512345" AdministratorPassword "P@ssw0rd"

描述

本範例會匯入名為 Deploy Windows 8 to Reference Computer 的工作順序,並在部署共用的 DS001:\Control\WIN8REFERENCE 資料夾中建立工作順序。 工作順序會指派批注「將 Windows 8 部署至參照計算機 (WDG-REF-01) 」。 工作順序的版本號碼設定為 1.00

與工作順序相關聯的操作系統位於部署共用中的 DS001:\Operating Systems\Windows 8_x64。 操作系統的已註冊擁有者將會設定為 Woodgrove Bank Employee。 已註冊的操作系統組織將會設定為 Woodgrove Bank。 Internet Explorer 首頁預設為 https://www.woodgrovebank.com。 本機內建系統管理員帳戶的密碼會設定為的 P@ssw0rd值。 操作系統的產品金鑰會設定為 1234512345123451234512345

範例 2

$OSObject=Get-Item "DS001:\Operating Systems\Windows 8_x64"
Import-MDTTaskSequence -Path "DS001:\Control" -Template "Client.xml" -Name "Deploy Windows 8 to Reference Computer" -ID "WIN8REFERENCE" -Comments "Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01)" -Version "1.00"-OperatingSystem $OSObject -FullName "Woodgrove Bank Employee" -OrgName "Woodgrove Bank" HomePage "https://www.woodgrovebank.com"  AdministratorPassword "P@ssw0rd"

描述

本範例會匯入名為 Deploy Windows 8 to Reference Computer 的工作順序,並在部署共用的 DS001:\Control\WIN8REFERENCE 資料夾中建立工作順序。 工作順序會指派批注「將 Windows 8 部署至參照計算機 (WDG-REF-01) 」。 工作順序的版本號碼設定為 1.00

與工作順序相關聯的操作系統位於部署共用中的 DS001:\Operating Systems\Windows 8_x64,使用 $OSObject 變數傳遞至 Cmdlet$OSObject變數會使用 Get-Item Cmdlet 設定為現有的作業系統物件。

操作系統的已註冊擁有者將會設定為 Woodgrove Bank Employee。 已註冊的操作系統組織將會設定為 Woodgrove Bank。 Internet Explorer 首頁預設為 https://www.woodgrovebank.com。 本機內建系統管理員帳戶的密碼會設定為的 P@ssw0rd值。 在部署精靈、CustomSettings.ini 檔案或 MDT DB 中部署此工作順序時,必須提供作業系統的產品密鑰。

New-MDTDatabase

本節說明 New-MDTDatabase Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

New-MDTDatabase [-Path <String>] [-Force] -SQLServer <String> [-Instance <String>] [-Port <String>] [-Netlib <String>] -Database <String> [-SQLShare <String>] [<CommonParameters>]

描述

此 Cmdlet 會建立與部署共用相關聯的新 MDT DB 資料庫。 每個部署共用只能與一個 MDT DB 資料庫相關聯。

參數

本小節提供可與 New-MDTDatabase Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定部署共用的完整 Windows PowerShell 路徑,新 MDT DB 資料庫會放置至該共用。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Force [<SwitchParameter>]

如果 Database 參數中 指定的資料庫已經存在,這個參數會指定應該重新建立 MDT DB 內的數據表。 如果此參數為:

  • 提供後,將會重新建立現有 MDT DB 內的數據表

  • 省略,則不會重新建立現有 MDT DB 內的數據表

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-SQLServer <字串>

此參數會指定將建立新 MDT DB 資料庫之執行 SQL Server 的電腦名稱。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Instance <String>

此參數會指定將建立新 MDT DB 資料庫的 SQL Server 實例。 如果省略此參數,則會在預設 SQL Server 實例中建立 MDT DB 資料庫。

注意事項

SQL Server Browser 服務必須在執行 SQL Server 的電腦上執行,Cmdlet 才能找出此參數中指定的實例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Port <String>

此參數會指定要用於與 SQLServer 參數中指定之 SQL Server 實例通訊的 TCP 連接埠。 SQL Server 使用的預設埠是 1433。 當 SQL Server 設定為使用預設值以外的埠時,請指定此參數。 此參數的值必須符合為 SQL Server 設定的埠。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Netlib <字串>

此參數會指定用來與 SQLServer 參數中指定之 SQL Server 實例通訊的 SQL Server 網路連結庫。 參數可以設定為下列其中一個值:

  • DBNMPNTW,用來指定命名管道通訊

  • DBSMSOCN,用來指定 TCP/IP 套接字通訊

    如果未提供此參數,則會使用命名管道 SQL Server 網路連結庫 (DBNMPNTW) 。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Database <String>

這個參數會指定要在 SQLServer 參數中指定之 SQL Server 上 Instance 參數所指定的 SQL Server 實中建立的資料庫名稱。 建立資料庫時,預設位置和命名慣例將用於資料庫和記錄檔。

如果這個參數中指定的資料庫已經存在,將不會重新建立資料庫。 資料庫內的數據表可以根據 Force 參數重新建立。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-SQLShare <字串>

此參數會指定 SQL Server 執行所在電腦上的網路共享資料夾名稱。 此連線可用來使用命名管道通訊協定建立 Windows 整合式安全性連線。

注意事項

如果未包含此參數,則不會建立安全的 IPC$ 連線。 因此,與 SQL Server 的命名管道通訊可能會失敗。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出已建立之新 MDT DB 的 PSObject 類型物件。

範例 1

New-MDTDatabase -Path "DS001:" -SQLServer "WDGSQL01" Database "MDTDB" -SQLShare "\\WDGSQL01\MDTShare$"

描述

此範例會在名為 WDG-SQL-01 的電腦上,於預設 SQL Server 實例中建立名為 MDTDB 的 MDT DB。如果資料庫已經存在,將不會重新建立現有資料庫中的數據表。 將會使用預設 SQL Server TCP 連接埠和命名管道通訊協定來建立連線。

範例 2

New-MDTDatabase -Path "DS001:" -Force -SQLServer "WDGSQL01" -Instance "MDTInstance" Database "MDTDB" -SQLShare "\\WDGSQL01\MDTShare$"

描述

此範例會在名為 WDG-SQL-01 的電腦上,於名為 MDTInstance 的 SQL Server 實例中建立名為 MDTDB 的 MDT DB。如果資料庫已經存在,則會重新建立現有資料庫中的數據表。 將會使用預設 SQL Server TCP 連接埠和命名管道通訊協定來建立連線。

Remove-MDTMonitorData

本節說明 Get-MDTPersistentDrive Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Remove-MDTMonitorData [-Path <String>] [-ID <Int32>] [<CommonParameters>]

-或-

Remove-MDTMonitorData [-Path <String>] [-ComputerObject <PSObject>] [<CommonParameters>]

描述

此 Cmdlet 會從部署共用中現有收集的監視數據中移除收集的監視數據。 您可以指定下列項目來識別要移除的監視資料:

  • 特定部署共用之監視專案的標識碼 (標識碼) 。 為部署共用建立專案時,系統會自動產生監視專案標識碼並指派給專案。 第一個語法範例說明此用法。

  • 部署共用中監視專案的計算機物件。 您可以使用 Get-MDTMonitorData Cmdlet 取得電腦物件。 最後一個語法範例說明此用法。

注意事項

拿掉監視數據之後,就沒有任何方法可復原資訊。

參數

本小節提供可與 Get- MDTMonitorData Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定所需部署共用的 MDTProvider Windows PowerShell 磁碟驅動器。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為所需 MDTProvider Windows PowerShell 磁碟驅動器內的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ID <可為 Null>

此參數會指定要使用監視數據項的標識碼移除的監視數據項。 如果未指定此參數,則必須指定 ComputerObject 參數來識別特定的監視數據項。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-ComputerObject <PSObject>

此參數會指定要使用計算機物件移除的監視數據項。 如果未指定此參數,則必須指定 ID 參數,以識別特定的監視數據項。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 可能會輸出 String 類型物件;否則,不會產生任何輸出。

範例 1

Remove-MDTMonitorData -Path "DS001:" -ID 3

描述

本範例會從 Windows PowerShell 路徑 DS001: 的部署共用中,移除標識碼為 3 的監視數據項。

範例 2

Remove-MDTMonitorData -ID 3

描述

本範例會從預設 Windows PowerShell 路徑的部署共用中,移除標識碼為 3 的監視數據項。

範例 3

$MonitorObject=Get-MDTMonitorData | Where-Object {$_.Name eq 'WDG-REF-01'}
Remove-MDTMonitorData -ComputerObject $MonitorObject

描述

此範例會移除電腦名稱為WDG-REF-01的任何監視數據項。 您可以使用 Get-MDTMonitorData Cmdlet 和 Where-Object Cmdlet 來找到物件。 如需 Where-Object Cmdlet 的詳細資訊,請參閱 使用 Where-Object Cmdlet

Remove-MDTPersistentDrive

本節說明 Remove-MDTPersistentDriveWindows Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Remove-MDTPersistentDrive [-Name] <String> [[-InputObject] <PSObject>] [<CommonParameters>]

描述

此 Cmdlet 會使用 Restore-MDTPersistentDrive Cmdlet,將使用 MDTProvider 建立的現有 Windows PowerShell 磁碟驅動器從保留在 Deployment Workbench 或 Windows PowerShell 會話中的磁碟驅動器列表中移除。 當部署共用關閉時,會呼叫此 Cmdlet, (從 Deployment Workbench) 移除。

注意事項

保存的 MDTProvider 磁碟驅動器清單會根據使用者配置檔中的每個用戶來維護。

您可以使用 Get-MDTPersistentDrive Cmdlet 來顯示儲存的 MDTProvider 磁碟驅動器清單。 您可以使用 Add-MDTPersistentDrive Cmdlet,將 MDTProvider 磁碟驅動器新增至保存的磁碟驅動器清單。

參數

本小節提供可與 Add-MDTPersistentDriveWindows Cmdlet 搭配使用的各種參數相關信息。

-Name <字串>

指定使用 MDT 提供者建立且對應至現有部署共用的 Windows PowerShell 磁碟驅動器名稱。 名稱是使用 New-PSDrive Cmdlet 建立,並在 PSProvider 參數中指定 MDTProvider

For more information on how to create a new Windows PowerShell drive using the MDTProvider and how to create a deployment share using Windows PowerShell, see the section "Creating a Deployment Share Using Windows PowerShell" in the MDT document, Microsoft Deployment Toolkit Samples Guide.

參數
Required? True
位置? 1具名
預設值
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-InputObject <PSObject>

此參數會指定稍早在程式中建立的 Windows PowerShell 磁碟驅動器物件。 輸入 PSObject 物件,例如 New-PSDrive Cmdlet 所產生的物件。

參數
Required? False
位置? 2具名
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 不提供任何輸出。

範例 1

Remove-MDTPersistentDrive -Name "DS001:"

描述

本範例會從保存的磁碟驅動器清單中移除具有 Windows PowerShell 磁碟驅動器名稱 DS001 的部署共用。

範例 2

$MDTPSDrive = Get-PSDrive | Where-Object {$_.Root -eq "C:\DeploymentShare" -and $_.Provider -like "*MDTProvider"}
Remove-MDTPersistentDrive -InputObject $MDTPSDrive

描述

此範例會從保存的磁碟驅動器清單中移除 C:\DeploymentShare$ 的部署共用。 GetPSDriveWhere-Object Cmdlet 可用來使用 $MDTPSDrive 變數,將 MDT 保存的 Windows PowerShell 磁碟驅動器傳回 Remove-MDTPersistentDrive Cmdlet。 如需 Where-Object Cmdlet 的詳細資訊,請參閱 使用 Where-Object Cmdlet。 如需 Get-PSDrive Cmdlet 的詳細資訊,請參閱 使用 Get-PSDrive Cmdlet

Restore-MDTPersistentDrive

本節說明 Restore-MDTPersistentDrive Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Restore-MDTPersistentDrive [-Force] [<CommonParameters>]

描述

此 Cmdlet 會將保存的 MDT Windows PowerShell 磁碟驅動器還原至每個部署共用的作用中 Windows PowerShell 磁碟驅動器列表,這些共用已新增至保存的 MDT Windows PowerShell 磁盤驅動器清單。 保存的 MDT Windows PowerShell 磁碟驅動器列表是使用 Add-MDTPersistentDriveRemove-MDTPersistentDrive Cmdlet 或 Deployment Workbench 來管理。

此 Cmdlet 會呼叫 New-PSDrive Cmdlet,為 MDT 保存清單中的每個磁碟驅動器建立 Windows PowerShell 磁碟驅動器。 保存的 MDT Windows PowerShell 磁碟驅動器類似於保存的網路驅動器機對應。

注意事項

此保存的 MDT Windows PowerShell 磁碟驅動器清單會以每位使用者為基礎進行維護,並儲存在使用者配置檔中。

參數

本小節提供可用於 Restore-MDTPersistentDrive Cmdlet 的各種參數相關信息。

-Force [<SwitchParameter>]

此參數會指定在必要時還原 (部署共用) 。 如果此參數為:

  • 如果必要,則在還原 (時會升級部署共用)

  • 省略,則在還原時不會升級部署共用

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會針對每個還原的 MDT Provider Windows PowerShell 磁碟驅動器輸出 PSObject 類型物件。

範例 1

Get-MDTPersistentDrive

描述

此範例會使用 MDTProvider 類型建立 Windows PowerShell 磁碟驅動器,以還原 MDT 保存的磁碟驅動器清單。 還原時不會升級部署共用。

範例 2

Get-MDTPersistentDrive -Force

描述

此範例會使用 MDTProvider 類型建立 Windows PowerShell 磁碟驅動器,以還原 MDT 保存的磁碟驅動器清單。 如有需要,在還原 (時,會升級部署共用) 。

Set-MDTMonitorData

本節說明 Get-MDTPersistentDrive Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Set-MDTMonitorData [-Path <String>] [-ComputerObject <PSObject>] [-Settings <Hashtable>] [<CommonParameters>]

-或-

Set-MDTMonitorData [-Path <String>] [-MacAddress <String>] [Settings <Hashtable>] [<CommonParameters>]

描述

此 Cmdlet 會在部署共用中建立新的監視數據項,或更新現有的監視數據項。 您可以指定下列項目來識別要移除的監視資料:

  • 部署共用中監視專案的計算機物件。 您可以使用 Get-MDTMonitorData Cmdlet 取得電腦物件。 第一個語法範例說明此用法。

  • 特定部署共用之監視專案的主要網路適配器 MAC 位址。 為部署共用建立專案時,MAC 位址會自動指派給監視數據項。 最後一個語法範例說明此用法。

注意事項

拿掉監視數據之後,就沒有任何方法可復原資訊。

參數

本小節提供可與 Get- MDTMonitorData Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定所需部署共用的 MDTProvider Windows PowerShell 磁碟驅動器。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為所需 MDTProvider Windows PowerShell 磁碟驅動器內的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-ComputerObject <PSObject>

此參數會指定要使用計算機物件建立或更新的監視數據項。 如果未指定此參數,則必須指定 MACAddress 參數來識別特定的監視數據項。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-MACAddress <字串>

此參數會指定要使用受監視電腦之主要網路適配器的 MAC 位址來建立或更新的監視數據項。 MACAddress 的格式為 xx:xx:xx:xx:xx:xx, 其中 x 是大寫 (中指定的十六進位字元) 。 如果未指定此參數,則必須指定 ComputerObject 參數來識別特定的監視數據項。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-Settings <Hashtable>

此參數會指定要建立或更新之監視數據項的監視數據設定。 這個參數所提供的哈希表格式為 @{"Setting"="Value"; "Setting1"="Value1"; "Setting2"="Value2}。 如果未指定此參數,則會建立監視數據項,但不會儲存任何監視資訊。

"Setting" 可以是 ZTIGather.xml 檔案中所列的任何屬性。 Value 可以是 中 "Setting"指定之 屬性的任何有效值。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 不會產生任何輸出。

範例 1

$MonitorObject=Get-MDTMonitorData | Where-Object {$_.Name eq 'WDG-REF-01'}
Set-MDTMonitorData -ComputerObject $MonitorObject Setting @{"OSDComputerName"="WDG-MDT-01";"SkipWizard"="YES"}

描述

此範例會移除電腦名稱為 WDG-REF-01 的任何監視數據項。您可以使用 Get-MDTMonitorData Cmdlet 和 Where-Object Cmdlet 來找到物件。 如需 Where-Object Cmdlet 的詳細資訊,請參閱 使用 Where-Object CmdletOSDComputerName 屬性會記錄為具有 WDG-MDT-01 的值,而且 SkipWizard 屬性會記錄為具有 YES 值。

範例 2

Set-MDTMonitorData -MACAddress "00:11:22:33:44:55" MonitorObject Setting @{"OSDComputerName"="WDG-MDT-01";"SkipWizard"="YES"}

描述

此範例會使用值為 00:11:22:33:44:55MACAddress 來建立或更新監視數據項。 OSDComputerName 屬性會記錄為具有 WDG-MDT-01 的值,而且 SkipWizard 屬性會記錄為具有 YES 值。

Test-MDTDeploymentShare

雖然此 Cmdlet 會使用 Get-Command Cmdlet 傳回為 Microsoft.BDD.PSSnapIn 嵌入式管理單元,但不會實作它。

Test-MDTMonitorData

本節說明 Test-MDTMonitorData Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Test-MDTMonitorData -ServerName <String> -EventPort <Int32> -DataPort <Int32> [<CommonParameters>]

描述

此 Cmdlet 會驗證在安裝 MDT 的電腦上執行的 MDT 監視服務是否已啟用並正常執行。 MDT 監控服務會收集可顯示的監視資訊:

注意事項

若要讓此 Cmdlet 正常運作,部署共用中必須至少有一個 MDT 監視數據項。 如果未記錄任何 MDT 監視資訊,部署共用將無法通過測試。

For more information on the MDT monitoring service, see the section "Monitoring MDT Deployments" in the MDT document, Using the Microsoft Deployment Toolkit.

參數

本小節提供可用於 Test-MDTMonitorData Cmdlet 的各種參數相關信息。

-Server <String>

指定安裝 MDT 且 MDT 監視服務正在執行的電腦名稱。

參數
Required? True
位置?
預設值
接受管線輸入嗎? False
接受通配符嗎? False

-DataPort <Int32>

此參數會指定用來作為 MDT 監視服務資料埠的 TCP 連接埠。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-EventPort <Int32>

此參數會指定用來作為 MDT 監視服務之事件埠的 TCP 連接埠。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會輸出布爾值,代表文字) 誤 () 或失敗的成功 (。

範例 1

Test-MDTMonitorData -Server "WDG-MDT-01" -DataPort "9801" EventPort "9800"

描述

此範例會確認 WDG-MDT-01 上的 MDT 監視服務是否已安裝並執行。 Cmdlet 會使用 9801 的數據埠和 9800 的事件埠進行驗證。

Update-MDTDatabaseSchema

本節說明 Update-MDTDatabaseSchema Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Update-MDTDatabaseSchema -SQLServer <String> [-Instance <String>] [-Port <String>] [-Netlib <String>] -Database <String> [-SQLShare <String>] [<CommonParameters>]

描述

此 Cmdlet 會將現有的 MDT DB 資料庫更新為最新版的 MDT DB 資料庫架構。 每個部署共用只能與一個 MDT DB 資料庫相關聯。

升級部署共用時會自動呼叫此 Cmdlet,例如使用 Force 參數和 Update-MDTDeploymentShare Cmdlet 執行 Restore-MDTPersistentDrive Cmdlet 時。

參數

本小節提供可用於 Upgrade-MDTDatabaseSchema Cmdlet的各種參數相關信息。

-SQLServer <字串>

此參數會指定執行 SQL Server 的電腦名稱,MDT DB 資料庫將在其中升級。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Instance <String>

此參數會指定要升級之 MDT DB 資料庫所在的 SQL Server 實例。 如果省略此參數,則會假設 MDT DB 資料庫位於預設 SQL Server 實例中。

注意事項

SQL Server Browser 服務必須在執行 SQL Server 的電腦上執行,Cmdlet 才能找出此參數中指定的實例。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Port <String>

此參數會指定要用於與 SQLServer 參數中指定之 SQL Server 實例通訊的 TCP 連接埠。 SQL Server 使用的預設埠是 1433。 當 SQL Server 設定為使用預設值以外的埠時,請指定此參數。 此參數的值必須符合為 SQL Server 設定的埠。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Netlib <字串>

此參數會指定與 SQLServer 參數中指定的 SQL Server 實例通訊時所使用的 SQL Server 網路連結庫。 參數可以設定為下列其中一個值:

  • DBNMPNTW,用來指定命名管道通訊

  • DBSMSOCN,用來指定 TCP/IP 套接字通訊

    如果未提供此參數,則會使用命名管道 SQL Server 網路連結庫 (DBNMPNTW) 。

注意事項

Deployment Workbench 不提供設定 SQL Server 網路連結庫的選項。 Deployment Workbench 一律會使用命名管道通訊。 不過,您可以在 CustomSettings.ini 檔案中設定 SQL Server 網路連結庫。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Database <String>

這個參數會指定要在 SQLServer 參數中指定之 SQL Server 實例上 Instance 參數中指定的 SQL Server 實中升級的資料庫名稱。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

此 Cmdlet 會針對已升級的 MDT 資料庫輸出 PSObject 類型物件。 如果包含 Verbose 通用參數,此 Cmdlet 也會輸出 String 類型數據。

範例 1

Update-MDTDatabaseSchema -SQLServer "WDGSQL01" Database "MDTDB"

描述

此範例會在名為 WDG-SQL-01 的電腦上,更新預設 SQL Server 實例中名為 MDTDB 之 MDT 資料庫的架構。系統會使用預設 TCP 連接埠和命名管道通訊協定,對 SQL Server 實例進行連線。

範例 2

Update-MDTDatabaseSchema -SQLServer "WDGSQL01" -Instance "MDTInstance" -Port "6333" Database "MDTDB"

描述

此範例會在名為 WDG-SQL-01 的電腦上,於名為 MDTInstance 的 SQL Server 實例中,更新名為 MDTDB 之 MDT 資料庫的架構。將會使用 TCP 連接埠 6333 和命名管道通訊協議來連線到 SQL Server。

Update-MDTDeploymentShare

本節說明 Update-MDTDeploymentShare Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Update-MDTDeploymentShare [-Path <String>] [-Force] [Compress] [<CommonParameters>]

描述

此 Cmdlet 會使用來自 Windows ADK 的最新檔案來更新現有的部署共用。 此 Cmdlet 也會以 WIM 和 ISO 檔案格式更新或重新產生必要的 Windows PE 開機映射。

參數

本小節提供可用於 Update-MDTDeploymentShare Cmdlet 的各種參數相關信息。

-Path <字串>

此參數會指定要更新之部署共用中現有資料夾的完整路徑。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

-Force [<SwitchParameter>]

此參數會指定是否應該完全重新產生部署共用 (.iso 和 .wim 檔案) 的 Windows PE 開機映射。 如果此參數為:

  • 接著,Cmdlet 會建立新版本的 Windows PE 開機映射。 此程式需要比優化現有 Windows PE 開機映像更多的時間。

  • 省略,然後 Cmdlet 會優化現有的 Windows PE 開機映射。 此程式所花費的時間比產生新版本的 Windows PE 開機映射少。 如果省略此參數, Compress 參數可用來減少開機映射的大小,作為 Windows PE 開機映像優化程式的一部分。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

-Compress [<SwitchParameter>]

此參數會指定當部署共用的 Windows PE 開機映射 (.iso 和 .wim 檔案) 優化時,是否應壓縮這些映像, (而不使用 Force 參數) 。 如果此參數為:

  • 提供時,Cmdlet 會在 Windows PE 開機映射優化時壓縮它們

  • 省略,則 Cmdlet 不會壓縮正在優化的 Windows PE 開機映像

注意事項

只有在未提供 Force 參數時,才應該提供此參數。 如果包含 Force 參數,則會產生新的 Windows PE 開機映射,並壓縮成最小大小。

參數
Required? False
位置?
預設值 -
接受管線輸入嗎? True (ByValue)
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 會輸出 String 類型數據,併產生其他 String 類型數據。

範例 1

Update-MDTDepoymentShare

描述

此範例會更新 Windows PowerShell 工作目錄中的部署共用。 Windows PE 開機映射將會優化。 不會壓縮 Windows PE 開機映像。

範例 2

Update-MDTDepoymentShare -Path "DS001:"

描述

此範例會更新 MDT Windows PowerShell 磁碟驅動器 上名為 DS001:的 部署共用。Windows PE 開機映射將會優化。 不會壓縮 Windows PE 開機映像。

範例 3

Update-MDTDepoymentShare -Path "DS001:" -Compress

描述

此範例會更新 MDT Windows PowerShell 磁碟驅動器 上名為 DS001:的 部署共用。Windows PE 開機映射將會優化。 將會壓縮 Windows PE 開機映像。

範例 4

Update-MDTDepoymentShare -Path "DS001:" -Force

描述

此範例會更新 MDT Windows PowerShell 磁碟驅動器 上名為 DS001:的 部署共用。將會產生新版本的 Windows PE 開機映像。

Update-MDTLinkedDS

本節說明 Update-MDTLinkedDS Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Update-MDTLinkedDS -Path <String> [<CommonParameters>]

描述

此 Cmdlet 會使用用來定義連結部署共用的選取設定檔,將內容從部署共用複寫到連結的部署共用。 復寫行為是根據連結部署共用的組態設定來決定。

參數

本小節提供可與 Update-MDTLinkedDS Cmdlet 搭配使用的各種參數相關信息。

-Path <字串>

此參數會指定要更新之連結部署共用的完整路徑。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 會輸出 String 類型數據,併產生其他 String 類型數據。

範例 1

Update-MDTLinkedDS -Path "DS001:\Linked Deployment Shares\LINKED001"

描述

此範例會將內容從部署共用復寫到 Windows PowerShell 路徑 DS001:\Linked Deployment Shares\LINKED001 資料夾的連結部署共用。

Update-MDTMedia

本節說明 Update-MDTMedia Windows PowerShell Cmdlet。 從已載入 MDT PowerShell 嵌入式管理單元的 Windows PowerShell 控制台執行此 Cmdlet。 For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see "Loading the MDT Windows PowerShell Snap-In".

語法

Update-MDTMedia -Path <String> [<CommonParameters>]

描述

此 Cmdlet 會使用用來定義部署媒體的選取設定檔,將內容從部署共用複寫到包含部署媒體的資料夾。 復寫行為是根據部署媒體的組態設定來決定。

LTI 中的媒體可讓您單獨從本機媒體執行 LTI 部署,而不需要連線到部署共用。 您可以將媒體儲存在 DVD、USB 硬碟或其他可攜式裝置上。 建立媒體之後,請產生可開機的 WIM 映像,以允許從目標電腦本機可用的可攜式媒體裝置執行部署。

參數

本小節提供可用於 Update-MDTMedia Cmdlet的各種參數相關信息。

-Path <字串>

此參數會指定包含正在更新之部署媒體的資料夾完整路徑。

注意事項

如果未提供此參數,則 Windows PowerShell 工作目錄必須預設為部署共用內所需的位置。

參數
Required? True
位置?
預設值 -
接受管線輸入嗎? False
接受通配符嗎? False

<CommonParameters>

此 Cmdlet 支援下列通用參數: Verbose、Debug、ErrorAction、ErrorVariable、OutBuffer、OutVariable、WarningActionWarningVariable。 如需詳細資訊,請參閱主題「about_CommonParameters」,您可以輸入下列命令,然後按 ENTER 鍵來存取此主題:

Get-Help about_CommonParameters

輸出

如果包含 Verbose 通用參數,此 Cmdlet 會輸出 String 類型數據,併產生其他 String 類型數據。

範例 1

Update-MDTMedia -Path "DS001:\Media\MEDIA001"

描述

此範例會將內容從部署共用復寫到 Windows PowerShell 路徑 DS001:\Media \MEDIA001 資料夾中包含部署媒體的資料夾。