I have been trying to uninstall applications on devices or users using SCCM. I have been successful in creating an application assignment that would install applications, but I haven't been able to get it to uninstall. The code I have been using is:
IResultObject assignment = this.manager.CreateInstance("SMS_ApplicationAssignment"); IResultObject application = this.manager.GetInstance("SMS_Application.CI_ID=16777339"); assignment["ApplicationName"].StringValue = application["LocalizedDisplayName"].StringValue; assignment["AssignedCI_UniqueID"].StringValue = application["CI_UniqueID"].StringValue; assignment["AssignedCIs"].IntegerArrayValue = new[] { application["CI_ID"].IntegerValue}; assignment["AssignmentName"].StringValue = "Deepak's deployment"; assignment["CollectionName"].StringValue = "Deepak's Collection of Devices";...↧