Upgrading to Office 2016/365 using a ConfigMgr Task Sequence

Upgrading to Office 2016/365 using a ConfigMgr Task Sequence

Earlier this year I did a presentation at the Central Texas Systems Management User Group (CTSMUG) in Austin on migrating our company to Office 2016 (MSI).  I have provided a link to my Sway of that presentation for some general context however this blog post will be a more technical explanation of how I went about upgrading all our systems to Office 2016.

Prerequisites

  • Working knowledge of ConfigMgr 2012/Current Branch Task Sequences.
  • An existing Application/Package for installing Office 2016/365, Visio, Project, etc. (If you need assistance with this, there is plenty of guidance here and here)

Before we get going, we need to create a new package called “Office 2016 Upgrade Files”.  This package will consist of detection scripts, Office Scrub scripts and any other custom code used for your overall upgrade process.  (NOTE: This package should NOT contain any of the actual Office installer binaries).

New-CMPackage -Name 'Microsoft Office 2016 Upgrade Files' -Path '\\SERVER\SOURCES\Microsoft Office 2016 Upgrade Files'

Content

Start by downloading the following scripts:

  • Get-MSOfficeProducts.ps1 – I developed this script to detect as many Microsoft Office (non-server) products that I had in my environment (NOTE: The language packs section needs improvement to cover more languages).
  • IME14-Cleanup.ps1 – This cleans up registry keys associated with the Office IME (Input Method Editor).

Next, use the “Easy Fix Download” link to obtain and extract the Office Scrub scripts for Office 2010+

Task Sequence – Detection

Start out by creating a new (empty) Custom Task Sequence.  The first stage of our Task Sequence will include detecting the software currently installed on the system.  This is broken out (generally) into two different groups.

  • Microsoft Office Suites and Applications (i.e. Visio, Project, Language Packs)
  • Office-Dependent Applications – Other software packages that have a dependency on one or more Office applications that may need special attention (reinstall) during an Office upgrade.

image

Removal

The next section will contain various scripts and command lines that we’ll use to remove Office-Dependent products and Office itself. First off, create a group (generally via WMI query or a file check) to detect and remove each application.  Be sure to add a custom Task Sequence variable as indicated in the screenshot above so you can use that to re-install the software later.

You “CAN” upgrade Office in-place without removing previous suites, however I always run into legacy shared components that get left behind.  When these are left behind, the system still  downloads ALL of the updates for the full suite (including service packs) so I prefer to perform a rip and replace of the Office suite.

Once you have removed the Office-Dependent applications, the next set of steps will systematically remove Microsoft Office.  I’ll list this out in order of how we did it as we had excellent success with this specific order of operations no matter what the system had installed.

  1. Remove Microsoft Office – This uses the Get-MSOfficeProducts.ps1 script from the Detection step but with the added –Uninstall parameter.  This step works well to remove Office 2003 components and some of the newer components using standard methods. NOTE: There is an Office Scrub script for Office 2003 available however I never verified that it worked. image
  2. Uninstall Office 2007 – I used the main Office 2007 Professional Plus installation media with custom Uninstall XML files to remove SharePoint Designer, Proofing Tools and the rest of the suite (in that order) since I already had the original package used to install it.  I’m not doing anything else related to Visio/Project or Language Packs during this section. NOTE: There is an Office Scrub script for Office 2007 available however I never verified that it worked. image
  3. Uninstall Office 2010/2013/2016 – Microsoft has published “scrub” scripts for each version of Office that work incredibly well.  Set these up as Run Command Line Steps in your Task Sequence with the following Command Line parameters for each:

Scrub Office 2010

cscript.exe OffScrub10.vbs ALL /log "C:\Windows\Temp" /quiet

Scrub Office 2013

cscript.exe OffScrub15.vbs ALL /log "C:\Windows\Temp" /quiet

Scrub Office Click-To-Run – Use this if you are installing Office 2016 MSI

cscript.exe OffScrubc2r.vbs ALL /log "C:\Windows\Temp" /quiet

Scrub Office 2016 – Use this if you are installing Office 365 Click-To-Run

cscript.exe OffScrub16.vbs ALL /log "C:\Windows\Temp" /quiet

NOTE: The scrub scripts run twice as sometimes the scrub fails due to a corrupted installation.  Running it twice typically takes care of things.

NOTE: You’ll want to run the Office 2016/C2R scripts to remove any potentially conflicting applications before installing Office.  C2R and MSI (2016) builds cannot co-exist.

Install Office 2016/365

Before you start installing Office 2016/365, consider rebooting the system.  This can often be required if you had to remove other Non-Office applications as part of your upgrade path.

I’m using the Application Model for all Office installers.  I have separate applications for the Office Suite separating 32-bit/64-bit.  All other Office components have both 32-bit and 64-bit within the same application.

During this section is where we will leverage the Task Sequence variables created by the Get-MSOfficeProducts.ps1 script to determine which components to reinstall.

Microsoft Office ProPlus Suite (32-bit/64-bit)

Use the MsOfficeSuiteArch TS Variable to determine which architecture of Office to install.

image

Microsoft Project (Standard/Professional)

Use the MsProjectStd or MsProjectPro TS Variables to determine if Project Standard or Professional needs to be reinstalled.

image

Microsoft Visio (Standard/Professional)

Use the MsVisioStd, MsVisioPrm or MsVisioPro TS Variables to determine if Visio Standard or Professional needs to be reinstalled.

image

Microsoft Proofing Tools Kit

Use the MsProofKit TS Variable to determine if the Proofing Tools Kit needs to be reinstalled.

image

Microsoft Office Language Packs

We use the Application Model for installing Office Language Packs.  These are separated by Language, and contain Deployment Types for each Office Version/Architecture to make things easy (for us and the end user).  Take note of the priority order.

image

Use the following TS Variables for Language selection:

  • MsLpChinese
  • MsLpCzech
  • MsLpDanish
  • MsLpDutch
  • MsLpFrench
  • MsLpGerman
  • MsLpHebrew
  • MsLpItalian
  • MsLpKorean
  • MsLpPolish
  • MsLpRussian
  • MsLpSpanish
  • MsLpSwedish

image

Re-Install Additional Applications

Here is where we begin reinstalling all of our Non-Office applications back onto the system.  This could either be a simple re-install, configuration change, or an update to an application to enable compatibility with the Office 2016 suite.

License Activation

We ran into some issues with KMS activation during our upgrades (using the MSI installer) so we added in the necessary ospp.vbs commands to activate Office in an attempt to “force” activation immediately after installation.  This reduced the number of helpdesk calls we received when activation took longer than normal.imageEnd Notification

Finally, we end the deployment by forcing a machine policy update, copying off log files and notifying the end user that the upgrade is complete (Notification HTA runs via the RunOnce registry key).

ConfigMgr Updates and Servicing Download Issues

I recently rebuilt my lab environment using Johan Arwidmark’s excellent Hydration Kit.  As part of this lab environment, I also setup a Virtual Router using Johan’s other guide http://deploymentresearch.com/Research/Post/387/Install-a-Virtual-Router-based-on-Windows-Server-2012-R2-using-PowerShell

If you haven’t considered using Johan’s hydration kit or virtual router setup, you should.  They are quick and easy (and repeatable).

I rebuilt the lab environment to test the new CM1606 upgrade in an environment setup more closely to my production environment.  After building the Domain Controller, Primary Site server and a couple clients to test with, it was time to start setting up all the necessary roles (Software Updates, Service Connection Point, etc.) and verify everything was working before testing the new CM1606 upgrade.

Issue

After verifying that the basics were working, it was time to upgrade to CM1602 and then 1606 using the nice new In-Console Updates and Servicing Node.  I checked the node, and it still said downloading.  I waited a day, restarted SMS_EXECUTIVE service, even rebuilt the entire lab using new media.

I checked the dmpdownloader.log and saw the error:

ERROR: Failed to call IsFileTrusted

clip_image001

I found another post with this same error but I the suggested fixes didn’t help me any.  I even tried the registry fix in the Release Notes.  Nothing.

Checking the EasySetupPayload directory I could see that the update files were actually downloaded.

clip_image001[5]

Checking the corresponding directory… rats. Empty.

clip_image001[7]

 

Resolution

After a series of trial and error (and a bit of cursing), I stumbled across a solution to my problem.

As part of the Virtual Router setup and overall lab configuration, I configured an Internal Hyper-V network for all my lab VM’s to run on.  The Virtual Router was configured with two VM’s and setup in a NAT configuration so the LAB VM’s could get out to the internet.

Here’s the issue (kind of).  On my ConfigMgr Site Server, it was only connected to the Internal Hyper-V Network.  So I decided to bypass the Virtual Router and add a second External (CORP) Network Adapter to the ConfigMgr Primary Site Server.

image

After booting the VM back up, ConfigMgr was able to successfully download and extract the updates and I was able to proceed with the upgrade.

Summary

So if you are using a Virtual Router for your ConfigMgr lab, make sure you give your Site Server direct access to the internet instead of routing it thru a Virtual NAT router.

MBAM Supported Computers Collection Issues after ConfigMgr 1606 Upgrade

I’ve been running on ConfigMgr 1602 since it was released and have had my environment integrated with Microsoft BitLocker Administration and Monitoring (MBAM) 2.5 SP1 since day one.  It’s worked wonderfully up until I applied the ConfigMgr 1606 in-console update.

For those of you that are not familiar with MBAM and it’s integration with ConfigMgr, check out Eswar Koneti’s excellent guide:

http://eskonr.com/2015/09/how-to-install-mbam-2-5-sp1-and-integrate-with-sccm-configmgr-2012-r2-sp1/

Issue

After the ConfigMgr 1606 update (Site Upgrade, not clients), I noticed an issue with the MBAM Supported Computers collection (which gets created as part of the MBAM + ConfigMgr Integration).  There were only about 500 systems out of ~14,000 that were in the collection now!

Over the next few days, that count slowly (and I mean slowly) grew to about 1,500 clients.  The collection member count fluctuated a few hundred each day but never got above about 1,700 clients.

Troubleshooting

I looked at the usual suspects like the Collection Evaluator being slow, WMI classes on the clients, and verified that clients were actually submitting Hardware Inventory (they were).

Upon looking further, there was 1 SQL View that wasn’t fully populated.  v_GS_TPM (Win32_TPM in HW Classes) is available for inventory right out of the box.  However MBAM requires it to be extended to include 3 properties.

image

I checked the number of rows in this SQL view using the following SQL script:

Select *
From v_GS_TPM

This returned only about 600-700 rows out of nearly 15K!  Checking some of the other MBAM Views such as v_GS_MBAM_POLICY or v_GS_BITLOCKER_DETAILS resulted in the proper number of rows.

Solution

The solution I came up with was to simply force a Full Hardware Inventory Scan on every client.  Once the clients forced a full update, they started showing back up in the collection and were happy again.

Note: You’ll want to stagger this deployment so you don’t overload your site server(s)!

Here are the PowerShell commands I strung together (Credit to Kaido Järvemets @kaidja) and deployed out via Package/Program to all my clients:

$HardwareInventoryID = '{00000000-0000-0000-0000-000000000001}'
Get-WmiObject -Namespace 'Root\CCM\INVAGT' -Class 'InventoryActionStatus' -Filter "InventoryActionID='$HardwareInventoryID'" | Remove-WmiObject
Invoke-WmiMethod -Namespace root\CCM -Class SMS_Client -Name TriggerSchedule -ArgumentList "$HardwareInventoryID"

Root Cause

At the time this article was written I do not know the root cause but I have been talks with a PFE and members of the product group to track it down.  I hope that this post will help others out there until the root cause can be determined and a fix put in place.

IE Enterprise Mode Edge Redirect Overwritten by ConfigMgr Client Settings

Like most companies out there, my company is getting ready to migrate to Windows 10.  As part of our migration, we are using IE Enterprise Mode to handle many legacy web applications to ensure our end users get the best experience possible, and reduce the manual effort to ensure they are using the proper browser (and browser mode).

IE Enterprise Mode includes the ability to automatically re-direct sites from Microsoft Edge to Internet Explorer on Windows 10.  This is fantastic for those who choose to use Edge as their default browser (as I do).

This post will not be covering exactly HOW to implement IE Enterprise mode as there is plenty of that documentation out there on the web.  Instead, I’ll be focusing on a recent discovery that my colleagues and I made.

Scenario

You’ve spent the last several months working with business partners to come up with a customized MS Edge redirect XML file and are ready to implement the file via GPP (or Compliance Settings or any other method you choose to set the registry key).  You choose to set this on a Per-User basis because you want it to follow the user, not the machine (don’t ask why, just assume this is the reason).

The registry key that gets configured with your custom MSEdge xml file is at:

HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main\EnterpriseMode

image

In addition to the above, you are running System Center Configuration Manager build 1602 (v1511 may also be affected – see below).

Problem

You expect this new XML file to redirect your custom LOB apps, but it doesn’t.  Upon further inspection within Edge (HINT: Use about:compat in the URL bar of Edge), you ONLY see entries for your site server (specifically the server hosting the Application Catalog site).

The Solution

I messaged David James (@djammer) on the ConfigMgr Product Team to confirm that the ConfigMgr Client Settings to add the Application Catalog URL in Trusted Sites is, indeed, using an MS Edge redirect XML file similar to that from IE Enterprise Mode.

image

As you can see from that last tweet, the solution (workaround really) is to set the reg key using the same path in the HKEY_LOCAL_MACHINE hive instead of HKEY_CURRENT_USER.  Doing so allows your custom IE Enterprise Mode XML file to load and not be overwritten.

This can be verified by looking at SoftwareCatalogUpdateEndpoint.log and looking for this

^5FCB47933F69467D8CC2FCE8E1986FCE8070048DB50421FD8A^pimgpsh_fullsize_distr

 

I hope this information can help someone else out there.  IE Enterprise Mode and ConfigMgr are awesome products and will be integral to a successful migration.

Create Pilot Collection Console Extension for ConfigMgr 2012 R2

I recently started working on my first ConfigMgr Console Extension (aka. Right Click Tool).  For my first foray into this new territory I decided to tackle something that myself and my colleagues deal with on a regular basis, Pilots.  No, not pilots that fly airplanes.  Pilot deployments.  The thing you do before deploying something to Production.

So today I’m releasing my Create Pilot Collection Console Extension for ConfigMgr 2012 R2.  The purpose behind this tool is to support some internal business processes wherein we as packagers are required to deploy larger scale deployments to a smaller “pilot” collection first.  I would imagine that your company has similar requirements as well.

This tool was built using Sapien PowerShell Studio 2015 and was designed to provide a quick and easy way of generating a random sampling of “Pilot Members” for your pilot deployments.

Create Pilot Collection - Main Screen

CREDIT

I’d like to thank Nickolaj Andersen (http://www.scconfigmgr.com) for writing and providing me with the Invoke-ToolInstallation.ps1 script to handle the installation of the Console Extension.  It’s been modified from his original version so I’ll provide a write-up on leveraging this script in a follow-up blog post.

Download

You can download the Console Extension from the TechNet Gallery.

I’ve included the PowerShell Studio Project Files if you would like to tinker and modify for your own use.

Install

To install the Console Extension, extract the .zip file you downloaded to a directory of your choice.  From an Administrative PowerShell Console, run the Invoke-ToolInstallation.PS1 script from the extracted directory.

NOTE: If you currently have the ConfigMgr Console open, you’ll need to close and re-open it.

Usage

To launch the tool, open your ConfigMgr console, and find a collection you wish to use as your “Base” collection.  This would typically be the collection you use for your final (Production) deployment.

The tool can be accessed from the Ribbon or the Right-Click Context Menu as shown below.

Right-Click MenuRibbon Icon

There are only two items you need to fill in.  The Pilot Collection Name and the Percentage of the original (base) collection to use as your pilot members.  The User Interface will update as you type to tell you how many members will be added to your new collection.

Create Pilot Collection - Main Screen

When you are finished, click the button, sit back and relax.  Once your collection is created you can deploy whatever you want to it.

NOTE: Large collections may take several minutes to process and add members.

Back to Blogging

I wanted to drop a quick note on here to everyone who continues to visit my blog.  I’ve been absent for the past nine months or so from the blogging scene due to an insanely busy life in and out of work.

In November my wife and I welcomed our second child (little girl) into the world and we recently just moved into our 4th home.  On top of that, my company underwent an extremely significant change that required a good majority of my time for the past 7 months.

With that said, things have finally calmed down enough to where I can start investing time into developing new solutions, and sharing my experiences with you all.  With this renewed focus on new technology and solutions, I felt it was also a good time for a new look for the blog.  It’s not a radical change but I think it gets the job done.

I am preparing a blog post for a new ConfigMgr Right Click Tool I recently developed so look out for it and more content in the coming weeks!

Yours Truly,

Dustin

Using a BitLocker Data Recovery Agent to unlock a BitLocker encrypted drive

This blog post is a follow-up to my first post on BitLocker, MBAM and Data Recovery Agents (DRA).

In this post we’ll cover actually USING the BitLocker DRA to recover/unlock a BitLocker Encrypted drive using the BitLocker DRA Certificate.

 

Installing a BitLocker DRA Private Certificate

Before you can actually unlock a drive using the DRA certificate, you must install the Private (.pfx) certificate file on your system. My recommendation is to install it under a local account (not a domain account) however to avoid a potential issue with Credential Roaming.

  1. Log into the system using a local (Administrative) account – again, this is to avoid the Private certificate from roaming with individual users and installing on multiple systems.
  2. Locate the BitLocker DRA (.PFX) private certificate file (obtained from your Certificate Authority) and double-click on it.
  3. Follow the wizard and provide the password for the private key (should be provided by your Certificate Authority also).

  4. Click Next thru the rest of the wizard pages.
  5. Delete the .PFX certificate file from the machine.

One other recommendation on this, I’d suggest that you keep track of who has this certificate and where it’s installed. When you have to renew the certificate this will make things much easier to go back thru and update the locally installed private certs.

 

Unlocking a BitLocker Encrypted Drive with a BitLocker Data Recovery Agent

Now that we have the Private (PFX) certificate installed, we can proceed with unlocking BitLocker encrypted drives. Unlocking a BitLocker Encrypted drive starts at the Command Prompt (Elevated) where we can then leverage the manage-bde.exe utility to work with BitLocker Drive Encryption.

  1. At the (elevated) Command Prompt, type manage-bde –protectors –get <drive letter> where <drive letter> is the drive you wish to unlock. You should see an output similar to below (Image credit: TechNet).

  1. Take special note of the Certificate Thumbprint highlighted above. That long string is your certificate ID which you will use to actually unlock the drive.

NOTE: It IS possible to have more than one Certificate listed here if your company uses more than one DRA cert for BitLocker. You may have to try each one until you get one to work

  1. To unlock the drive, type manage-bde –unlock <Drive Letter>: -Certificate –ct <Certificate Thumbprint>


 

Conclusion

That’s pretty much all there is to it. Recovering a BitLocker encrypted drive with a BitLocker DRA Certificate is pretty simple once it’s all setup. Of course I still would recommend using MBAM or Active Directory recovery methods as your primary recovery method (they are a lot easier) however this will hopefully give you that ‘warm & fuzzy’ feeling knowing that you can always unlock a BitLocker encrypted drive.