4/12/2011

Programmatically creating AppV Deployments in ConfigMgr

When creating AppV Packages programmatically in ConfigMgr there are some things to consider as they do have programs like classic packages. It's important that the program name is the following string: [Virtual application]. If you use asterisk (*) or a any other string the package will not install.

Here's a example how to create an AppV Program in VB.Net

Set objNewProgram = oWMIService.Get("SMS_Program").SpawnInstance_()
objNewProgram.ProgramName = "[Virtual application]"
objNewProgram.PackageID = strPackageID


If you want to create a Task Sequence which installs a AppV package you've also to define this string as the program name.

Set objTSAction = connection.Get("SMS_TaskSequence_InstallSoftwareAction").SpawnInstance_
objTSAction.PackageID=strPackageID
objTSAction.ProgramName="[Virtual application]"
objTSAction.Name=strName

No comments: