Modify SCCM Program question

Aug 1, 2011 at 4:16 PM

I am trying to modify the "Supported Operating Systems" property, but the only value choices are String, DateTime, Boolean, or Interger.  Unfortunately I end up with this error:

Unable to cast object of type 'System.String' to type 'System.Array'.

Exception: SmsConnectionException
Target site: WqlQueryPropertySingleItem.set_StringValue

Stack trace:
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryPropertySingleItem.set_StringValue(String value)
   at OpalisSCCMInterop.CMInterop.modifySCCMProgram(WqlConnectionManager connection, String existingPackageID, String existingProgramName, String objType, String objName, String objValue)
   at OpalisSCCMExtension.ModifyProgram.Execute(IOpalisRequest request, IOpalisResponse response)

Am I right in assuming that the value choice of "Array" is needed to make this work, or is there another work around?

Thanks for any help!


Aug 1, 2011 at 4:54 PM
Edited Aug 1, 2011 at 9:17 PM

Hey Eric,

Are you using the Modify Package: Set Supported Operating Systems object?  Because of the way this value is expected to be entered there is a special object for it.

Aug 2, 2011 at 2:41 PM

When I use that object, I'm getting this:

Not found , property = AlternateContentProviders

Exception: WqlQueryException
Target site: WqlResultObjectBase.get_Item

Stack trace:
   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlResultObjectBase.get_Item(String name)
   at OpalisSCCMExtension.package..ctor(IResultObject obj)
   at OpalisSCCMExtension.ModifyProgramSupportedPlatform.<getObjects>d__0.MoveNext()
   at Opalis.QuickIntegrationKit.Framework.Core.FilterSet.Filter(IEnumerable values)
   at Opalis.QuickIntegrationKit.Framework.Core.FilteredResponse.PublishRange(IEnumerable values)
   at OpalisSCCMExtension.ModifyProgramSupportedPlatform.Execute(IOpalisRequest request, IOpalisResponse response)

I have been able to create a package, program, collection, and advertisement, so things are mostly working really well. 



Aug 5, 2011 at 5:04 PM

What are you using as inputs to the object?

Aug 8, 2011 at 8:56 PM

Existing Package ID = STG00CA0

Existing Program Name = Machine

New Max Version = 5.10.999.999

New Min Version = 5.10.0000.0

New Name = Win NT

New Platform = I386