output collection members

Welcome Forums General PowerShell Q&A output collection members

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #6565

    Points: 0
    Rank: Member

    by dw_anderson at 2012-11-02 05:44:16

    I want to output members of a device collection to a file. I imported the sccm 2012 powershell module. I'm getting an error though.

    get-cmdevicecollection -name "eyemaginations" | gc membercount

    Here's the output:

    get-cmdevicecollection : The adapter cannot get property "ReadCount" for
    instance of SMS_Collection
    CollectionID = "CMB00100";
    CollectionRules = {
    instance of SMS_CollectionRuleDirect
    ResourceClassName = "SMS_R_System";
    ResourceID = 16779309;
    RuleName = "L-01382";
    instance of SMS_CollectionRuleDirect
    ResourceClassName = "SMS_R_System";
    ResourceID = 16779896;
    RuleName = "SEI_117";

    Thanks in advance.

    by coderaven at 2012-11-02 20:44:42

    This is a beta PS command. It will take me a little to build a test env to look at what is going on here.

    if you are just trying to output to file why would something like this not work?
    get-cmdevicecollection -name "eyemaginations" | Export-CSV eye-members.csv
    Or if you are trying to pull count just do this
    (get-cmdevicecollection -name "eyemaginations").Count

    by dw_anderson at 2012-11-05 05:25:21

    Thanks Allan, I will try these. What I ended up doing is running a collection report in the SCCM console and exporting to a csv from there.

    -Drew Anderson

The topic ‘output collection members’ is closed to new replies.