Tuesday 4 October 2016

SCCM Distribution Point Content Information - SQL Query

This is a SQL query which will give you a detailed report of all distributed packages on a SCCM distribution point which includes information about Package Size, PackageID, Name, Description etc. This is a very helpful query if you want to do some clean up on your distribution point and looking for some package size information report.
Just change below the FQDN of Distribution point and Site Code.

select  all SMS_DPContentInfo.Description,SMS_DPContentInfo.IsPredefinedPackage,SMS_DPContentInfo.NALPath,SMS_DPContentInfo.Name,SMS_DPContentInfo.ObjectID,SMS_DPContentInfo.ObjectType,SMS_DPContentInfo.ObjectTypeID,SMS_DPContentInfo.PackageID,SMS_DPContentInfo.SourceSize from fn_ListDPContents(1033) AS SMS_DPContentInfo  where SMS_DPContentInfo.NALPath = N'["Display=\\FQDN of Distribution Point\"]MSWNET:["SMS_SITE=SiteCode"]\\FQDN of Distribution Point\'

Friday 27 June 2014

Integrate UDI with your SCCM task sequence for optional software deployments

Traditionally, MDT has always been the “lite touch” (LTI) deployment solution providing interaction during task sequences to input a computer name, choose your OU, choose packages to install, etc. Alternatively, SCCM has been the “zero touch” (ZTI)  solution, where these configurations are scripted, assigned from task sequence variables, or grabbed from a database, requiring no input during deployment. There have always been ways to prompt for input in SCCM task sequences, but they were fairly limited until the introduction of UDI (User-Driven Installation) a few years ago. UDI has merged these two worlds, providing a much more interactive, MDT-like task sequence experience in your SCCM deployments.
I recently had a client that wanted to run OS deployments from SCCM (because of central management and infrastructure requirements), but also wanted the interaction in their task sequences that MDT provides out of the box. Specifically, they wanted to use a “checklist” for optional software installs, a drop-down list of OUs to choose from, and a place to enter the computer name. Luckily, these are all available with UDI integration.
UDI task sequence templates become available in SCCM once you integrate MDT into your installation. The default templates are actually really good and provide several interactive screens during the deployment process. Luckily, they are also very customizable, so we can cut out a lot of the stuff we don’t want the end user to see. If you don’t already have a package for MDT files created in SCCM, go ahead and make one. You can do this by creating a new MDT task sequence from template.

In this guide, we’re going to deploy two pieces of software, Visio Viewer, which is packaged as a traditional software program, and Adobe Reader, which is packaged as a software application. Both formats are supported. We’re going to be working with a pretty standard task sequence. I’ve cut it down to make it as simple as possible to understand, but if you need a starting point, check the bottom of this post for a task sequence that you can import into your SCCM 2012 R2 environment. You can see that this is a standard refresh task sequence, but can also be used for bare metal deployments. There are a few steps below that have been added in to support UDI.
First, we need to load the MDT Files package. This contains the UDI XML file that we will customize in this guide.


Next, we need to run the gather step. Use a settings file, if you typically use one in your deployments.
Next, we’re going to call the UDI Wizard. This is where the optional software checklist is going to appear for the user. The command used is:
cscript.exe "%DeployRoot%\Scripts\UDIWizard.wsf"
Now, skip down to the portion of your task sequence that installs software. This is somewhere after the Setup Windows and ConfigMgr step. Create a new “Run Command Line” step, and name it “Convert UDI App List”. For the command line input, use:
cscript.exe "%deployroot%\scripts\ZTICoalesce.wsf" /CoalescePattern:Applications /CoalesceTarget:CoalescedApps /CoalesceDigits:2
This is a required step to make our checklist of apps usable in SCCM. 



Next, we can Install Optional Applications. This is a standard “Install Application” step, but add a base variable called COALESCEDAPPS. This represents that list of optional software that the user has checked.

Next, we’re going to do the same thing, but for Software Programs. Use another base variable, but name this one PROGRAMS.
For the past two task sequence steps, go to the options tab and set them to Continue on Error. In the case that the user selects no optional software during the deployment, this step may actually return an error.
UDIAPP012
Save and close your task sequence.
Before we go into the UDI Wizard Designer, we need to modify the default settings for our software packages/applications. Both applications and packages have a checkbox we need to enable for UDI software deployment. It’s named “Allow this program to be installed from the Install Package task sequence without being deployed.” For software packages, this is located under the program properties here:
UDIAPP030
And for software applications, it’s located here:

UDIAPP031
You’ll need to create a device collection that all of your optional software can be deployed to. The UDI tool will use this to determine what software is available to deploy. Create software deployments for each of your applications and packages, targeting your specific collection.
UDIAPP025
Make the deployment Available. In this guide, my collection is named “OSD Optional Software”.
UDIAPP026
You will get a warning that the collection is empty. This is OK.
UDIAPP027
Finish the deployment wizard using the default settings. No schedule is required.
Now, we’re ready to open up the UDI Wizard Designer. It’s part of the Microsoft Deployment Toolkit, which should already be installed and integrated at this point.
UDIAPP015
Now, we need to open up UDIWizard_Config.xml . This file is located in your SCCM package for MDT Files. There’s a folder inside called scripts. The XML is located here.
UDIAPP016
This is the out-of-the-box version of UDIWizard_Config.xml. Every possible UDI step is enabled by default, but we don’t want to use them all. Go through the different StageGroups, and delete every item except for Install Programs. Optionally, if you want to use any of the other steps here (computer name, OU, etc) you can leave them in.
UDIAPP017
When you’re finished cleaning it up, it should look something like this:
UDIAPP018
You can delete the entire StageGroup: Replace page and items. We won’t need them for this deployment.
UDIAPP045
Now, select the Install Programs Application page from the page library on the left.
UDIAPP019
Under Edit Settings in the ribbon, open Configuration Manager.
UDIAPP020
We’re now going to integrate the UDI Wizard Designer with the SCCM installation. Enter your SCCM server name, and then type in the exact name of your target collection for all of your optional software deployments that we created earlier. Verify your settings to make sure you don’t get an error.
UDIAPP022
Now, go back and select Edit Software Settings from the same ribbon menu.
UDIAPP023
Verify that your base variables are set correctly. It should be APPLICATIONS for your software applications and PACKAGES for your software packages. The APPLICATIONS variable will later be converted to COALESCEDAPPS in your task sequence, but don’t use that here!
UDIAPP024
Now, under Optional Software, open the Configure tab. You can customize the name of this page to better suit your environment. I changed mine to Optional Software.
UDIAPP032
This is where you can edit your software list, also. Remove the sample application through the right-click menu.
UDIAPP033
Use the same menu to Add Software to Group. You can also create multiple groups. Customize as you please!
UDIAPP034
You can add both software packages and applications to this list. I’ll be using both in this guide.
UDIAPP035
For packages, you can choose a 32-bit or 64-bit program to deploy, depending on the architecture. You can also choose a default program to deploy for both instances. Click select to search your SCCM environment for available software.
UDIAPP036
If you have properly deployed your software to the collection defined previously, it will appear black. If it’s grayed out, check your deployment, or double-check your software properties to see if it’s allowed to deploy from task sequences (earlier step).
UDIAPP037
If using a software package (not an application), choose the proper program for your installation. Choose an additional 64-bit package, or use the same package for both.
UDIAPP038
Applications work exactly the same as programs in this regard. When finished, you should have a new software option added to your list.
UDIAPP043
You’ve now completed everything required in the UDI Wizard Designer – save your changes! You can always come back and make changes later to add additional software choices.
UDIAPP044
One very important step before trying your deployment is to update the MDT Files package in SCCM. Otherwise, all the changes you just made will not take effect during your OS deployment. Right-click your package, and Update Distribution Points.
UDIAPP046
Once your package has been updated and distributed, you should be ready to try out your new task sequence with optional software checklist. The UDI Wizard should now appear during your task sequence, with the list of optional software to choose from. Your optional software should be installed when the task sequence completes.
UDIAPP048
For reference, here’s a copy of my UDIWizard_Config.xml and the task sequence used in this guide that you can import into your installation.