Right-Click Option: Showing the Collection Membership of a Resource in ConfigMgr 2012 via PowerShell

DeviPropDeplLast week someone triggered me that it wasn’t possible to ‘just’ see all the collections that a device is a member of. The only thing I could show, and tell, him, at that moment, was the Deployments –tab in the Properties of the device. The problem with this is that it only show the collections, of which the device is a member, with a deployment targeted. So it misses all the collections, either without an deployment targeted, or with client/ antimalware settings targeted. This triggered me to create a small PowerShell script to show the Collection Membership of a specific device in a nice form.

Show Collection Membership Form

ShowCollMemb07This script creates a nice form to show the Collection Membership of the specified device. It shows all the extra information for the following collections:

  • Collections targeted with (all types of) Deployments,
  • Collections targeted with Client Settings,
  • Collections targeted with Antimalware Policies,
  • Collections targeted with nothing!

Usage

This script can be used, either ‘standalone’, or as a right-click option. The command line usage examples can be found in the script and on TechNet (link is provided at the end of this post). To use this script as a right-click action, follow the next steps:

  • Close the Configuration Manager Console.
  • Create the folder C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\XmlStorage\Extensions\Actions\ed9dee86-eadd-4ac8-82a1-7234a4646e62.
  • Create the folder C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\XmlStorage\Extensions\Actions\3fd01cd1-9e01-461e-92cd-94866b8d1f39.
  • Create in both new folders a new XML file with the following content (keep an eye on the location of the PowerShell script, either place it on the location specified with the parameters, or change the location).
<ActionDescription Class="Group" DisplayName="Custom Actions" MnemonicDisplayName="Custom Actions" Description="Custom Actions" SqmDataPoint="53">
    <ShowOn>
        <string>ContextMenu</string>
    </ShowOn>

    <ActionGroups>
        <ActionDescription Class="Executable" DisplayName="Show Collection Membership" MnemonicDisplayName="Show Collection Membership" Description="Show Collection Membership">
            <ShowOn>
                <string>ContextMenu</string>
            </ShowOn>
            <Executable>
                <FilePath>PowerShell.exe</FilePath>
                <Parameters>-ExecutionPolicy ByPass -WindowStyle Hidden "D:\Data\PS_ShowCollectionMembership\ShowCollectionMemberShip_v0_7p.ps1" -ResourceId "##SUB:ResourceId##" -SiteCode "##SUB:SiteCode##" -SiteServer "##SUB:__Server##"</Parameters>
            </Executable>
        </ActionDescription>
    </ActionGroups>
</ActionDescription>

  • RighClicActiStart the Configuration Manager Console.

Availability

As of today my Show Collection Membership Form is publicly available via the TechNet Galleries. Please let me know what you think of the form.

3 thoughts on “Right-Click Option: Showing the Collection Membership of a Resource in ConfigMgr 2012 via PowerShell

Leave a Comment