Sunday, 25 July 2010

Inventory Windows 2008 Roles in ConfigMgr

One of my staff is currently designing our new Citrix XenApp 6 farm and I've set him the task of doing as much of the software deployment and building of it via SCCM as possible.

While we were talking about it he mentioned it would be good if we could have a dynamic collection containing all 2008 R2 servers with the Remote Desktop Session Host feature installed rather than having to remember to keep adding servers all the time.

So I showed him how to edit the sms_def.mof (found in %Drive%\Microsoft Configuration Manager\inboxes\clifiles.src\hinv) to add the following:

[ SMS_Report (TRUE),
SMS_Group_Name ("Server Feature"),

class Win32_ServerFeature : SMS_Class_Template
[SMS_Report (TRUE), key ] uint32 ID;
[SMS_Report (TRUE) ] uint32 ParentID;
[SMS_Report (TRUE) ] string Name;

This then allowed us to create a collection with a query looking for a Server Feature that equaled 130.

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_CUSTOM_SERVER_FEATURE_1_0 on SMS_G_System_CUSTOM_SERVER_FEATURE_1_0.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like "%Server 6.1%" and SMS_G_System_CUSTOM_SERVER_FEATURE_1_0.ID = 130

You can find a reference list of 2008(R2) roles here:

No comments: