IT Consultant Everyday Notes

Just some problems/solutions storage

Tag Archives: OSD

SCCM: Task Sequence Import fails (System.NullReferenceException)

I am leading a Windows 10 migration project currently. We prepared TAsk Sequences in Dev environment and SCCM admin tried to export/import them from Dev to Prod. Export was successfull, but Import miserably failed with

System.NullReferenceException

Object Reference not set to an instance of an object.

As usual very nice and descriptive SCCM error.

Fortunately Mike Terrill bumped into it before and wrote about it: https://miketerrill.net/2016/07/31/import-task-sequence-failure-cm-1606/

Note: When we tried to open a zip file containing TS archive using internal Windows Zip packer it failed. We used 7zip – it opens/saves the archive successfully.

SCCM: Clean encrypted drive before TS start

One of my Customers happens to have a McAfee encrypted drives on Laptops and Desktops he plans to migrate to Windows 10. Unfortunately McAffee version was not cooperative with SCCM and he was ok to clean the drives.

To achieve that I added a file called diskpart.txt on my file server (where my Network Access Account has access)

The file contains two lines:

Select disk 0
Clean

After that I customized the boot image by adding a pre-start command and pointing the boot image to the shared folder containing my configuration file:

image

The script is invoked after you press ‘Next’ on OSD dialog logon page but before you select any Task Sequence.

Did the trick for me.

SCCM: Windows 10 changes Default Application set for Adobe .pdf files

I am helping to create/deploy a Windows 10 image in one of my Customers environment. There is a requirement to have Adobe Reader DC in a Gold Windows 10 image.

I am preparing the Gold Image with MDT 2013 Upd 2 and deploy it with SCCM (build 1606).

One of issues we faced is a Software Association for Adobe Reader .pdf files: Even though Adobe Reader setup was customized with Customization Kit and Adobe Reader was set as default Application for PDF files after imaging we observe Microsoft Edge set itself as a default app for PDFs . Sad smile

I googled the issue and found I am not alone… Unfortunately the most common advice is to start Reader and configure it as default app in GUI (for example here is Adobe guide: https://helpx.adobe.com/acrobat/kb/not-default-pdf-owner-windows10.html). Work fine I guess for non-enterprise environment, but not suitable for my case. In addition it will set association for the current user only (http://www.winhelponline.com/blog/edge-hijack-pdf-htm-associations/)

Assoc command described here: https://support.microsoft.com/en-us/kb/184082 does not seem to be working in Windows 10. I mean even though assc .pdf  shows correct association Edge is still the default app Smile

I finally found a way to manipulate association with DISM command (https://technet.microsoft.com/en-us/library/hh824855.aspx)

So, here is the solution I am using:

1. On a reference machine with Adobe Reader installed (but not set as a default App for PDF) export default application configuration to a .XML file using dism command: “DISM.exe /Online /Export-DefaultAppAssociations >your.xml

2. Open the XML file in Notepad and delete unnecessary lines before XML header

3. Browse the XML to see association for .pdf

4. Here is a trick. You need aplicationID of Adobe Reader to be able to replace ApplicationID of EDGE you have in the XML. I right-clicked a PDF document and selected Open With. I see the prefered App is Edge, but the Reader is just after that. So in the XML file I copied the first ID from “OverwriteOfProgIdIs” parameter to ProgId parameter. Hopefully the explication is clear. Anyway, my line for .pdf association looks like:

<Association Identifier=”.pdf” ProgId=”AppX86746z2101ayy2ygv3g96e4eqdf8r99j” ApplicationName=”Adobe Reader” ApplyOnUpgrade=”true” OverwriteIfProgIdIs=”AppXk660crfh0gw7gd9swc1nws708mn7qjr1″ />

After that I I import the XML file back to Windows using:

Dism.exe /Online /Import-DefaultAppAssociations:your.xml

Please note, even that won’t change association for the current user. But, all new users will get it set properly.

So I created an additional application in my MDT to import the pre-created XML and inserted the Application Deployment step in my TS and re-generated the image. As soon as the image is deployed all domain users should have Adobe Reader as a default app for PDFs.

Note: I guess I could use offline servicing to inject XML into the image during the image creation and it would help with association for “Administrator”, but I guess online approach  is easier and cleaner.

 

You can also try a per-user GPO as described here: https://www.adobe.com/devnet-docs/acrobatetk/tools/AdminGuide/pdfviewer.html

SCCM: OSD to a KNOWN computer using media – There are no task sequences available for this computer.

 

At one of my Customer sites I migrated SCCM 2012 to SCCM CB and tried to deploy an OSD TS to a collection containing test machines.  I added a test machine manually using its MAC address and add it to a collection where the TS was deployed.

As soon as I boot the machine using generated SCCM Boot Media i got a message:

“There are no task sequences available for this computer.”

SMSTS.Log file showed the machine as “KNOWN”, but TS was not available for it. ^%&^%%

Resolution: I removed the machine from SCCM database and re-added it manually again. I think the migrated account contained a GUID from the old SCCM and probably that was an issue. Not sure for 100%, but it works now.

SCCM: Boot image tuning

Johan published several boot image tuning tips allowing to avoid the following errors:

“Failed to find a valid network adapter”

“No Policies found”

How to set bigger logs: Understanding-logging-in-ConfigMgr-OS-Deployment

Add drivers to the boot image. Dell WinPE driver Pack is here: 11530.winpe-10-driver-pack

 

The article is here: http://deploymentresearch.com/Research/Post/538/Building-the-perfect-ConfigMgr-boot-image

SCCM: Windows 10 in-place upgrade Task Sequence improvements

MVP Johan Arwidmark published two things to change in standard SCCM CB Windows 10 in-place upgrade TS:

source is here

Adding Setup Upgrade Assessment and Driver support

As you probably know, ConfigMgr Current Branch has a built-in task sequence template for Windows 10 Inplace-Upgrades. This template is used for Windows 7/8/8.1 to Windows 10 upgrades as well as Windows 10 to Windows 10 upgrades (when a new build is available).
However, the default task sequence template for inplace upgrades are missing some useful features. This post shows you how to add them.

Adding Setup Upgrade Assessment and Driver support
The features I recommend adding to the Inplace-Upgrade task sequence is a setup upgrade assessment action, as well as support for injecting drivers.
1. Edit your Inplace-Upgrade task sequence, add an extra Upgrade Operating System action, configured it to continue on error, and rename it to Upgrade Assessment

Adding the upgrade assessment action.
The compatibility scan will always spit out a non-zero return code, for example 0xC1900210 which is the no issues found return code. The return code is set in a new read-only task sequence variable, the _SMSTSOSUpgradeActionReturnCode variable, and the reason for having a variable that, is so you can use it further down the line in the task sequence. The important thing is that even though Windows setup spits back a hexadecimal value, ConfigMgr reads it as a decimal value, so you need to do some conversion. For example 0xC1900210 in hex is 3247440400 in decimal.
2. Modify the Upgrade the Operating System group to use a task sequence variable as condition: Add _SMSTSOSUpgradeActionReturnCode, and set the value to 3247440400.

Configuring the Upgrade the Operating System group with a condition.
Next up is adding driver support, and in this example I had a Windows 10 driver package for a HP Elitebook 8560w.
3. In the Upgrade the Operating System group, add a new group named Drivers, and then use the new (for v1511) Download Package Content action to download the driver package. Also set a condition to only download the package if you’re deploying to that model.
4. Configure each Download Package Content action to save the path as a variable, in my case I used a custom path of C:\W10Drivers andW10Drivers as the variable

Adding Download Package Content actions with driver packages.
5. Finally, configure the Upgrade Operating System action to use the drivers by selecting Staged content to %W10Drivers01%.
Note: Don’t forget to add “01” to the end of the variable or it won’t work.

Windows 7: April 2016 Convenience Pack

How to integrate all post SP1 updates to your Win 7 SP1 media. Great time saver!

http://www.fosund.com/slipstream-the-convenience-rollup-update-april-2016-with-windows-7-enterprise-x64/

SCCM: Lenovo BIOS upgrade in SCCM TS

Bill Dunn published a nice post about the subj. Just in time for my next project! Thank you Bill.

From Bill Dunn’s post:

Lenovo BIOS Updates in the Task Sequence

The question popped up in a forum the other day about how people handle the upgrade of Lenovo BIOS in a Task Sequence.  There are several ways of course which can be handled, of variable sophistication.  Mikael Nystrom developed a solution for me several years back which I used for several years and enhanced on my own, in MDT Task Sequences.  However when my organization was shifting to SCCM Task Sequencing I was asked to develop something a bit lighter. The old solution kept all the BIOS update files in one very large (500MB+) package.  Clearly not the right solution in SCCM where every package used has to be downloaded from the DP during imaging. 
I moved to a much lighter solution for SCCM. 
Each BIOS revision is kept in its own container package (that’s what I call them anyway, a package with no assigned program, just used to hold content for use by something else).  Its basically the same idea as an SCCM Toolkit package, or Settings package.
Creating the BIOS packages:

  1. Go out to Lenovo and download the BIOS for each model for which you want to perform an upgrade during imaging.
  2. Extract the BIOS packages into a structure on your Package content share similar to:
    \\servername\imagecontent$\BIOSpackages\Lenovo\T450-V1.45
    \\servername\imagecontent$\BIOSpackages\Lenovo\T440-V2.08
    \\servername\imagecontent$\BIOSpackages\Lenovo\T430-V2.65
  3. Use the Administrator Console to create one Legacy type package from each of these folders
    (using the example above you’ll end up with 3 packages)
  4. Distribute these packages

Task Sequence Changes:

  1. Someplace after the machine has booted into Windows for the first time place the steps to perform the BIOS upgrades.  Be sure that the you place them after the Use Toolkit and Gather steps. 
  2. Create a new TS Group for the BIOS Updates to nest under, it makes turning the BIOS updates off if needed easier and keeps the TS cleaner
  3. Under the BIOS Updates group create a Run Command Line step for Model to be upgraded
    • The command line in each case will be “Winuptp.exe /S” this is the BIOS update installer for all Lenovo Laptop models and is contained in every BIOS update.  The “/S” tells it to run quietly and automated with new GUI. It will also suppress rebooting. 
    • Add a condition on the step using a WMI query so this step will only run for the proper model
      select * from win32_computersystemproduct where version = “ThinkPad T430”
    • Add a reference to the proper BIOS Package for the model being updated buy this step.
      • I’ve found it easiest to create the step once the copy it for each model, updating the package reference and the name of the step to reflect the proper model
    • It s a good idea to place a reboot computer step soon after the BIOS updates complete.  Be sure to put Use Toolkit package and Gather steps immediately after the reboot.

    I have exported the BIOS Steps from my Production TS, you should be able to import this open the stub TS, then copy and paste the steps into your own TS.  The Package References will be broken, because I didn’t export the content.  My packages have naming and paths in them that I’d prefer not to expose.  You will only need to create the proper packages and update the references if you start with my stub.

    OSD: Microsoft Surface Deployment Accelerator

    Video on a new Surface Deployment Accelerator (native MS tool integrated with MDT 2013 Upd 1) : https://www.youtube.com/watch?v=0k3Y4tnqGUE

    SCCM: Remove Built-in apps when creating a Windows 10 reference image