Deprovisioning Modern Apps In Your Windows 8.1 Reference Image using MDT 2013 and Powershell

Been keeping pretty busy with an amazing new job here in Albuquerque, where I’ve been working on some new Windows 8.1 Enterprise images which we’ll be loading on both Surface and Samsung tablets.

Say what you will about Windows 8, the reintroduction of the start button, combined with it’s improved security, boot time, and battery life make it a serious contender for your next mobile device image. Remember, Windows 7 is almost five years old now.

Problem is, yes, some of the Modern Apps don’t make sense for a business to keep. Now, while I’ve known for a while that one single line of PowerShell can remove ALL modern apps:

Get-AppxPackage -AllUsers | Remove-AppxPackage

I’ve come to find out however that this doesn’t really de-provision the apps from the device. That is to say, if I hand this system to my boss after a sysprep and capture, those apps I thought I was removing will still be waiting for him when he signs in. So I needed a way that would remove some (but not all) the apps, pause, let me config the start menu the way I wanted it, and then make that the default start menu layout for all users.

Little bit of googlin’ led me to this glorious, glorious script courtesy Ben Hunter.

See: TECHNET SCRIPT: Removing Windows 8.1 Built In Applications

Testing did reveal that this script does in fact deprovision a customized list of Modern Apps.

So, here’s what I did:

Customized the Script

  1. Kept apps I don’t want in list of apps to remove
  2. Removed apps I wanted to keep in my image from the list
  3. Saved this script to the scriptroot of the share \\server\share\scripts

Created a ‘Build Windows 8.1’ Task Sequence in my MDT Build Share

  1. Configured task sequence to install Dot Net 3 & 2
  2. Added DotNet 4.5 to the share
  3. Added Office 2013 to the task sequence
  4. Added The Powershell script to the Task Sequence
  5. Added LTI Suspend to the Task Sequence

Created a Hyper-V VM on my 8.1 Enterprise laptop

  1. Assigned 1GB RAM to VM
  2. Configured VM to boot from ISO in my Build Share

Booted to the Buildshare.

  1. Selected Win8 Build Task Sequence
  2. Selected to capture a wim image from the LTI wizard.
  3. Let MDT build an image for me.
  4. When LTI Suspend Paused the sequence, I customized the Start Menu.
  5. Resumed the task sequence
  6. Went and ate some tacos while MDT captured the image for me.

Script
The part that kills modern apps.

NewScript
Erase apps you want to keep. Leave apps that you don’t.

Add
Once you’ve saved the script to the scripts folder, add it to your sequence here.

Boot
Boot your VM to your build share. Here I can pick whether I want to build a windows 7 image or 8.

LTISuspend1
LTISuspend.WSF pauses the task sequence so I can customize windows and the default user profile.

Before
The powershell script ran, notice some apps are gone.

Menu
I then customized the start menu, this is the start Menu all users will get.

StartMenuNow
Apps are gone.

Resume
Once everything’s good, capture a checkpoint of your VM and double ckick Resume Task Sequence.

Now, as long as copy profile true is set in my production share’s unattended.xml file , anybody who signs in will get the custom start menu, wallpaper, and those apps I removed will be gone. Now, this is just a “preference” not a “policy”, the users will be free to change the tiles on the menu how they see fit, but Office 2013 will be there in the start menu, as long with the control panel. Pretty slick huh?

TECHNET SCRIPT: Removing Windows 8.1 Built In Applications

Powershell Por Vida!

Advertisements