MDT

PowerShell is King–Convert Windows Server Editions during OS Deployment (MDT/LiteTouch)

Yesterday I posted a simple UI based PowerShell script that allows the local administrator of the server to change the Windows Edition. That is is a nice to have function, but what if you would like to do that during the deployment of the server instead of after. This way you can have two task sequences, one for Standard and one for datacenter but just have one WIM file (also means one reference image). For the same reasons I mentioned in the previous post,  I have created some scripts for this.

You can read the previous post on the UI method here https://deploymentbunny.com/2014/07/01/powershell-is-kingconvert-windows-server-editions-using-a-ui-based-powershell-script/

All three options here are using the same base logic with the same kind of option. Instead of defining every different “upgrade” , I decided to have just 2, NEXT and TOP. When TOP is selected as an option it will upgrade to the TOP Edition, in other words Datacenter. When NEXT is selected, it will do the NEXT level. That means that a standard will be datacenter, unless it is a 2008 r2, then a standard will be enterprise. Evaluations will be the “same, so a standard evaluation, will be a standard . In a bit more detail, this is what the scripts actually do…

What kind of conversion can the scripts perform?

Source OS   UpgradeLevel Destination OS
Windows Server 2008 R2 Standard to NEXT Windows Server 2008 R2 Enterprise
Windows Server 2008 R2 Standard   TOP Windows Server 2008 R2 Datacenter
Windows Server 2008 R2 Enterprise   NEXT/TOP Windows Server 2008 R2 Datacenter
Windows Server 2012 Standard Evaluation   NEXT Windows Server 2012 Standard
Windows Server 2012 Standard Evaluation   TOP Windows Server 2012 Datacenter
Windows Server 2012 Standard   NEXT/TOP Windows Server 2012 Datacenter
Windows Server 2012 R2 Standard Evaluation   NEXT Windows Server 2012 R2 Standard
Windows Server 2012 R2 Standard Evaluation   TOP Windows Server 2012 R2 Datacenter
Windows Server 2012 R2 Standard   NEXT/TOP Windows Server 2012 R2 Datacenter

 

Option No:1 (VB Script as an Application)

The first option is to use a VBscript and run it as an application, that gives a great logging and integration with the Task Sequence in MDT. The script uses a Custom property called UpgradeLevel (which can be set to either NEXT or TOP) that you needs to be added to CustomSettings.ini

Step By Step, kind of…

Download Script from : http://1drv.ms/TBO9Zw

Add the Custom property UpgradeLevel.

image

Import the Application in the Deployment Workbench.

image

Modify the Task Sequence (add a Set Task Sequence Variable Step)

image

Modify the Task Sequence (Add the Application)

image

Deploy a Server and check the logfile.

image

Option No:2 (PowerShell Script as an Application)

The second option is to use a PowerShell script instead, still running as an application, I added some logic to discover the presence of a Task Sequence, that way logging can end up in the correct location

Step By Step, kind of…

Download Script from : http://1drv.ms/TBOgEn

Add the Custom property UpgradeLevel.

image

Import the Application in the Deployment Workbench

image
The command line is a bit long so here it is in text form
PowerShell.exe -ExecutionPolicy Bypass -File Upgrade-SKU.ps1 -UpgradeLevel %UPGRADELEVEL%

Modify the Task Sequence (add a Set Task Sequence Variable Step)

image

Modify the Task Sequence (Add the Application)

image

Deploy the server and check the logfile.

image

Option No:3 (PowerShell Script in TaskSequence)

The third option is to run it as a PowerShell task Sequence

Step By Step, kind of…

Download Script from :http://1drv.ms/1qjoOAk

Save the script in the scripts folder

Modify the Task Sequence (Run PowerShell script)

image

Modify the Task Sequence (Add a reboot Action)

image

Deploy a server and check the logfile.

image

/mike

4 replies »

  1. Wow, great script/feature. I have one question. Does MS support this kind of modification? My lead would like to know before giving the go ahead. Thks

    • Microsoft does support to change from evals to standard/datacenter and they support to change from standard to Datacenter. You can find the information on TechNet. However, it is not supported to use eval versions in production, also it isnot supported to change they key on a domain controller.

  2. Thanks for this. Very helpful. One question: I don’t understand the purpose of your $SOURCEROOT variable. You set it to “$SCRIPTDIR\Source”, but it’s not used for anything.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.