ConfigMgr Tool – Content Location Request Generator

Recently Gabriel Alicea @ConfigMgrGeek asked me on a Twitter PM if I could help him get a handle on using the ConfigMgr 2012 Client Messaging SDK in C# that is available in the ConfigMgr 2012 R2 SDK, and use it to generate a Content Location Request.

 

His first port of call would be the help (CHM) file in the SDK for Client Messaging:

 

image

 

Ton of information in there exposing the Microsoft.ConfigurationManagement.Messaging namespace, very handy to have to hand, some examples in there too:

 

image

 

There is also this handy post from Adam Meltzer who is a ConfigMgr Product Group Engineer over at Redmond. It’s pretty much a primer and on-ramp showing how to use the Client Messaging SDK in C#.

 

If we were writing in C++ then Russ Slaten another Redmond engineer would have the complete solution laid out for us here.

 

 

You’ll find the Microsoft.ConfigurationManagement.Messaging.DLL here which you can register in Visual Studio and begin programmatically accessing:

 

image

 

I found the most tricky part of talking to the Management Point for a Content Location Request was handling the response, I did it this way in C#:

 

ConfigMgrContentLocationRequest clr = new ConfigMgrContentLocationRequest();

 

[ Do stuff with clr object …]

 

ConfigMgrContentLocationReply cmReply = new ConfigMgrContentLocationReply();

cmReply = clr.SendMessage(Sender);

 

That code snippet should go a long way towards helping you to handle the response from the Management Point.

 

Since we’re talking about Management Points, Adam Meltzer has written a lot about their behaviour, here’s one of his blog posts covering how Management Point Selection works: http://blogs.msdn.com/b/ameltzer/archive/2013/06/17/quick-summary-on-how-management-point-selection-works-in-flexible-formerly-native-mode-in-configuration-manager-2012.aspx

 

It’s definitely worth keeping an eye on Adam’s posts, he talks about stuff at a technical level that I feel at home with, he explores parts of the product and goes beyond the documentation, immediately of interest to any serious ConfigMgr (SCCM) administrator, he’s one of many Product Group engineers that blog so go look them up over on MSDN Blogs

 

And this leads onto the CLRGen tool, Content Location Request Generator, once I’d written up a code example for Gabriel in Visual Studio and got it all working, It wasn’t much more effort to wrap it up as an application and make it available on my TechNet Gallery, and here it is:

 

image

 

It allows you to select any Package, and then it let’s you choose a Management Point, provide a Certificate if it is needed and you are ready to ask that Management Point for a list of Distribution Points that the selected Package is known to be on.

 

This isn’t a replacement for Package checking inside or outside of the ConfigMgr Console, it is simply a tool using the CCM Messaging SDK to perform a quick and easy Ping against any Management Point in your Hierarchy that you have network access too.

 

I hope the coding comments, links and all are useful, if you need more info or would like to just chat you can Tweet me here.

 

image 

 

Have fun with the tool!