Configuring MDT Deployment Share settings via PowerShell

About two weeks ago I was finishing up writing an upcoming PowerShell book together with fellow MVP Mikael Nystrom. During the book development process we ran into having to configure a MDT deployment share, and since it's a PowerShell book, of course we wanted to do it in PowerShell. So, here is how.

Creating a MDT Deployment Share

To configure/modify a deployment share, you need to have one. I already posted an article on that part, so please use this script to create one:

Creating the MDT Deployment share using PowerShell
https://deploymentresearch.com/Research/tabid/62/EntryId/102/Creating-the-MDT-2012-2013-Deployment-share-using-PowerShell.aspx

Configuring a MDT Deployment Share

The script in the previous section creates a deployment share in the C:\MDTProduction\DS folder. Here is how it looks when opened in Deployment Workbench:

image

Now, I wanted to configure the settings of my deployment share. To do that you use the Set-ItemProperty, like this:

# Connect to the MDT Production Deployment Share
Import-Module "C:\Program Files\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1"
new-PSDrive -Name "DS002" -PSProvider "MDTProvider" -Root "C:\MDTProductionDS"

#Configure DeploymentShare
Set-ItemProperty -Path DS002: -Name SupportX86 -Value 'False'
Set-ItemProperty -Path DS002: -Name Boot.x64.ScratchSpace -Value '512'
Set-ItemProperty -Path DS002: -Name Boot.x64.IncludeAllDrivers -Value 'True'
Set-ItemProperty -Path DS002: -Name Boot.x64.SelectionProfile -Value 'WinPE x64'
Set-ItemProperty -Path DS002: -Name Boot.x64.LiteTouchWIMDescription -Value 'MDT Production x64'
Set-ItemProperty -Path DS002: -Name Boot.x64.LiteTouchISOName -Value 'MDT Production x64.iso'

After running the above PowerShell script, here is the updated deployment share settings.

image
Deployment Share settings after update.

If you want to enumerate the settings, you can use the Get-ItemProperty.

New-PSDrive -Name "DS002" -PSProvider MDTProvider -Root "C:\MDTProductionDS"
Get-ItemProperty DS002:

You can of course also create an object and use that:

$MDTSettings = Get-ItemProperty DS002:
$MDTSettings | Select *
image
Result from enumerating the deployment share settings.

/ Johan

About the author

Johan Arwidmark

0 0 votes
Article Rating
Subscribe
Notify of
guest
6 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
JoeZeppy412
JoeZeppy412
7 years ago

I'd be honored 🙂

Admin
Admin
7 years ago

Nice script, would you mind if I created a separate post with that script? With proper credits of course?

/ Johan

JoeZeppy412
JoeZeppy412
7 years ago

I wrote a script to dump the apps and drivers from my share to a CSV, just to get a flat view of everything I have and where it is. # === begin ===Add-PSSnapIn Microsoft.BDD.PSSnapIn New-PSDrive -Name MyDrive -PSProvider mdtprovider -Root d:DEPLOYMENT01 get-childitem 'MyDrive:Out-of-Box Drivers' -recurse | select name, class, @{n="OS-string";e={($_ | select -expa OSVersion) -join ',' }}, @{n="Platform-string";e={($_ | select -expa Platform) -join ',' }}, NodeType, guid, PSParentPath | export-csv c:mdtDrivers.csv -NoTypeInformation get-childitem MyDrive:APPLICATIONS -recurse | select pschildname, commandline, workingdirectory, enable, CreatedTime, LastModifiedTime, guid | export-csv c:mdtapps.csv -NoTypeInformation Remove-MDTPersistentDrive MyDrive remove-PSSnapIn Microsoft.BDD.PSSnapIn Write "Export complete to c:mdtDrivers.csv and c:mdtapps.csv"… Read more »

loewie1984
loewie1984
7 years ago

Great thanks!

Admin
Admin
7 years ago

Hi Rens

From the example in this guide, simply type dir DS002: once you created the PSDrive.

/ Johan

loewie1984
loewie1984
7 years ago

Hi Johan,

Very great and usefull post, I'm fiddling with PowerShell and MDT myself too, but do you perhaps know how I can LIST / DIR the MDT PSDrive? Or is that not possible?

I just wanted to see the MDT directory/folder structure in powershell

Thanks

Cheers! Rens


>