title: c# to create direct membership rules for SCCM 2012
body: <p>I am trying to build a C# application offering most common SCCM 2012 functions used by our 1st level support teams globally.</p>
  
  <p>Therefore one of the most important function is to add computers (resourceIDs) to a collection as a DirectMembershipRule.</p>
  
  <p>I have already done the similar things with Powershell and also created a GUI. But as multithreating and also the GUI makes the "script" more and more unstable I would like to continue with a DotNet application.
  Unfortuantely I am not experienced at all in C#. Altough I could already manage to read from our SQL database and gather already collection names, computers of a collection and others.</p>
  
  <p>Adding to a collection seems to happen most reliable through WMI method and there I got stuck completely. I managed to receive WMI data like Bios Info or Disk info from our server but was not able to trigger methods creating a new instance for a Membership rule.</p>
  
  <p>I would be very happy to get some help here.
  :-)</p>