2

SMS 2003 contained a great feature for automation via the excellent dll: Microsoft.SystemsManagementServer.Automation.dll. It allowed automating SMS using intuitive objects, properties and methods such as:

SMSProvider.Packages.Create("NewPackage");

In SCCM 2007, it seems this great dll has been deprecated in favor of more WMI style "dog's breakfast" code:

var conn = new WMIConnection(@"\\Server\root\sms\site_a", usr, pass);
var queryResults = conn.ExecuteQuery("SELECT * FROM SMS_Package WHERE 
                                      Name='" + packageName + "'");
foreach (ManagementObject obj in queryResults)
{
    packageID = (string)obj.GetPropertyValue("PackageID");
}

I am tempted to write my own skeleton classes around these wmi calls. All that seems needed for basic automation would seem to be: SccmServer, SccmPackage, SccmProgram and SccmTaskSequence.

The question is: does anyone have wrapper, skeleton classes like this available, or know of any open source projects that I can use or adapt? I hate reinventing the wheel for mundane stuff like this.

Stein Åsmul
  • 2,566
  • 4
  • 25
  • 38
  • Just for the record, I already found this: http://social.technet.microsoft.com/Forums/en-US/configmgrsdk/thread/07432f0d-09a6-40fb-be38-32898d6a93e8. The question is if someone has started wrapping the new SCCM2007 calls in better wrapper classes. – Stein Åsmul Oct 09 '09 at 23:33

1 Answers1

1

This isn't quite as what you are looking for but have you had a look at using Powershell and SCCM to take some of the WMI pain away?

You might also want to look at:

There don't seem to be many Powershell cmdlets yet that provide the same level of functionality as Microsoft.SystemsManagementServer.Automation.dll but I did find PowerShell Community Extensions for Configuration Manager.

Sim
  • 1,858
  • 2
  • 17
  • 17