membership - Verify if a PC is a member of a specific SCCM collection -


i looking script in powershell or vb check current pc verify member of specified sccm 2012 collection.

we want can create multiple deployment types , assign them different collections, use deployment type requirements make sure deployment types deploy correct collection. not want create multiple applications same media when there slight variations in installation parameters.

i believe there should basic script check if current pc member of collection dr100038 (as example) , return 1 or 0.

with colleague, had luck following (powershell , wmi inside), sccm not providing @ moment right commandlets :

  • for device, id:

    $deviceid=(get-wmiobject -computername -namespace root\sms\ -class sms_r_system -filter "name=''").resourceid

  • search collections linked :

    get-wmiobject -computername -namespace root\sms\ -class sms_collectionmember_a -filter "resourceid='$deviceid'"

  • filter resulting list

i found solution, digging in https://skydrive.live.com/?cid=030bc1ea09f784f6&id=30bc1ea09f784f6!213&sc=documents#cid=030bc1ea09f784f6&id=30bc1ea09f784f6!222&sc=documents, query_pc_collection_membership.ps1 (kudos kaido).

enjoy,

pn9


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -