Quantcast
Channel: Configuration Manager 2012 - Application Management forum
Viewing all articles
Browse latest Browse all 4762

Put Instance SMS_ApplicationAssignment fails with "ERROR: Property array AssignedCIs is empty" Relates to VBS (WinScriptHost 5.7) NOT PS

$
0
0

Posted here because I'm not using Powershell.

I cannot seem to get the SMS Provider to recognize the AssignedCIs data I'm passing to it as part of a put.

In order to eliminate the possibility of type mismatch in casting or whatever, I am obtaining the SMS_ApplicationAssignment.AssignedCIs directly from SMS_ApplicationLatest.CI_ID using a sub.  Using an intervening variable instead, makes no difference.

Whatever I do, the put fails. 

Checking SMSProv.log shows:

a) the select CI_ID  from SMS_ApplicationLatest returns without error.  (And echoing the value returned displays expected data.)

b) The put always fails with "ERROR: Property array AssignedCIs is empty"

Can anybody confirm that SMS_ApplicationAssignment.AssignedCIs actually does map to SMS_ApplicationLatest.CI_ID in an instance put? 

Has anyone actually done it with vbs?  Please don't reply with powershell code....  Thank-you.

Set Assignment = wmiservices.Get("SMS_ApplicationAssignment").SpawnInstance_ Assignment.<various_properties except CI_ID> = <various_data> rem snip 'use sub to load Assignment.AssignedCIs get_CI_ID Assignment ' this is a sub Assignment.Put_

sub get_CI_ID(ByRef UA) 'Note that global var 'app_ModelName' has been previously set with the correct value dim wmi,sms, query, o query = "" & _"select " & vbCrlf & _"CI_ID " & vbCrlf & _"from SMS_ApplicationLatest " & vbCrlf & _"where " & vbCrlf & _"ModelName = '" & app_ModelName & "'" set wmi = GetObject("winmgmts:\\" & PSERV & "\root\sms\site_" & PSITE) set sms = wmi.ExecQuery(query) if sms.Count = 1 Then for each o in sms UA.AssignedCIs = o.CI_ID ' this populates the Assignment.AssignedCIs property exit for next End If set sms = Nothing set wmi = Nothing End Sub



Viewing all articles
Browse latest Browse all 4762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>