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.
Import the Application in the Deployment Workbench.
Modify the Task Sequence (add a Set Task Sequence Variable Step)
Modify the Task Sequence (Add the Application)
Deploy a Server and check the logfile.
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.
Import the Application in the Deployment Workbench
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)
Modify the Task Sequence (Add the Application)
Deploy the server and check the logfile.
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)
Modify the Task Sequence (Add a reboot Action)
Deploy a server and check the logfile.
/mike
Categories: MDT, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2
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.
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.
It is generic script stuff that I use in other scripts