April 2010 - Posts
This report is based off the canned report in ConfigMgr called ‘Packages Referenced by a specific task sequence’ but it also includes references to packages from the MDT database (location, roles, makemodels) and also is queried by distribution point.
This report is meant to give you a complete look at all packages that may be referenced by a task sequence AND the MDT database and give you the results by distribution point. This allows you to have a quick look at what distribution point might be missing a referenced package, especially from the MDT Database as the task sequence does not verify these packages before it begins.
The Assigned column states if the package has been assigned to the distribution point. The State column displays the status of that package if it has been assigned.
Assigned column must be ‘Yes’ and State column must be ‘Ok’ in order to get all expected packages installed from that distribution point when running that specific task sequence with those MDT values applied.
Linked Servers
This report *does* use Linked Servers in order to access the MDT database. If you are not familiar with setting up a Linked Server in your SQL environment, check out these articles here first.
Garth Jones
http://www.myitforum.com/articles/2/view.asp?id=7274
John Nelson
http://myitforum.com/cs2/blogs/jnelson/archive/2008/04/04/114622.aspx
Edit Report
Once you have created a linked server, all you need to do is import this MOF as a report. Then edit the report and replace every piece of the report that has [192.168.1.120] with your linked server such as [MySQLBox]. This also includes the SQL statements in the prompts as well.
P.S. My linked server is an IP address as seen in the report because on my test network my MDT database and SCCM database are both on the same server. And you cannot create a link to the same server by name, so you must use something like an IP Address. Technically if they are both on the same server you could just create views in SQL to do this instead of linked servers, whatever you prefer.
Download Report
TS_DP_MDT_Ref.mof
Screenshots

Even though we use Maik Koster’s MDT Web FrontEnd we still had some requirements to be able to run a quick report on referenced packages by a certain location, role, or MakeModel via the MDT database. Another requirement is the Package Name which the MDT Database does not include.
Therefore I created a quick and simple report that references both the MDT 2010 database and ConfigMgr’s database for Package name in order to display these results. I figured I would provide the MOF for this report for others to use/modify.
This report *does* use Linked Servers in order to access the MDT database. If you are not familiar with setting up a Linked Server in your SQL environment, check out these articles here first.
Linked Servers
Garth Jones
http://www.myitforum.com/articles/2/view.asp?id=7274
John Nelson
http://myitforum.com/cs2/blogs/jnelson/archive/2008/04/04/114622.aspx
Edit Report
Once you have created a linked server, all you need to do is import this MOF as a report. Then edit the report and replace every piece of the report that has [192.168.1.120] with your linked server such as [MySQLBox]. This also includes the SQL statements in the prompts as well.
P.S. My linked server is an IP address as seen in the report because on my test network my MDT database and SCCM database are both on the same server. And you cannot create a link to the same server by name, so you must use something like an IP Address. Technically if they are both on the same server you could just create views in SQL to do this instead of linked servers, whatever you prefer.
Download Report
MDT_DB_Ref.mof
Screenshots

I have updated the powershell script in which I posted about in in this blog post.
Michael Niehaus posted a blog post that described how to use powershell to automate the checking and replicating of referenced packages in a task sequence to all DPs. This was great work and the blog can be found here. Please read it first. :)
I updated the script to include Windows Form Prompts and the ability to select a specific task sequence and specific distribution point.
I updated the following items from version 1.0:
- ConfigMgr Server Prompt now uses a windows form to keep in form with the other prompts
- Task Sequence prompt has checkbox to allow ‘All Task Sequences’
- Distribution Point prompt also has checkbox to allow ‘All Distribution Points’
- Added new prompt with datagrid showing the missing packages asking to replicate them
- Updated comments, removed unnecessary code I included in the first version.
Version 1.2 Update:
- Fixed an issue with Distribution Points being assigned to the central server, and not their primary server. (Work around for New-SCCMPackageDP function)
Version 1.3 Update:
- Now includes SCCM.PSM1 version 1.5 from Michael Niehaus. This includes a fix for the New-SCCMPackageDP function that correctly assigns the sitecode to the DP.
Feel free to give feedback or modify and make it even better.
CheckTSPrompt V1.3
Screenshots:
Connect:
Select Task Sequence:
Select Distribution Point:
Replicate?

*Updated Script/post found here!:* - Updated (4-27-2010)
Michael Niehaus posted a blog post that described how to use powershell to automate the checking and replicating of referenced packages in a task sequence to all DPs. This was great work and the blog can be found here. Please read it first. :)
For our environment though we had multiple task sequence (including test task sequences) with nearly 100 distribution points. Therefore we didn’t necessarily want all TS’s and their referenced packages to be copied to all DPs. So all I did was took Michael’s posted powershell script and added prompts, allowing us to choose which TS and which DP to actually check and replicate to. See screenshots and zip file below:
Also I am still quite new at Powershell so forgive any of my sloppy code and feel free to clean it up as necessary or if you see a better way of processing this. :)
Enter Server Name:
Select Task Sequence
Select Distribution Point:
Results text:
Download Powershell Script Here
P.S. You will want to follow Michael’s instructions for making sure the SCCM module gets put into the proper location and also that execution policy gets set correctly. Follow Michael’s blog to get this working first.
Thought I’d share this since it came up on the email list recently. Here is a very simple vbs script that sets the volume name of the C: drive to match the computer name.
******************* CODE BELOW **********************
'********************************************************************************************************
'* Set Volume Name for Computer
'********************************************************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Get ComputerName
Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
For Each objItem in colItems
computername = objItem.Name
Next
'Set Volumename to Computername
Set colDrives = objWMIService.ExecQuery("Select * from Win32_LogicalDisk where DeviceID = 'C:'")
For Each objDrive in colDrives
objDrive.VolumeName = computername
objDrive.Put_
Next