public void Execute(IActivityRequest request, IActivityResponse response) { SCCMServer = settings.SCCMSERVER; userName = settings.UserName; password = settings.Password; String objID = request.Inputs["CI_ID"].AsString(); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); using (connection) { String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_AuthorizationList"); foreach (String propertyName in propertyNameChoices) { if ((request.Inputs.Contains(propertyName + " : Property Type")) && (request.Inputs.Contains(propertyName + " : Property Value"))) { CMInterop.modifySCCMAuthorizationList(connection, objID, request.Inputs[(propertyName + " : Property Type")].AsString(), propertyName, request.Inputs[(propertyName + " : Property Value")].AsString()); } } IResultObject col = null; col = CMInterop.getSCCMAuthorizationList(connection, "CI_ID LIKE '" + objID + "'"); if (col != null) { response.WithFiltering().PublishRange(getObjects(col)); } response.Publish("Number of Authorization Lists", ObjCount); } }
public void Design(IActivityDesigner designer) { designer.AddInput("CI_ID").WithDefaultValue("11189"); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password); String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_AuthorizationList"); String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" }; foreach (String propertyName in propertyNameChoices) { designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired(); designer.AddInput(propertyName + " : Property Value").NotRequired(); } designer.AddCorellatedData(typeof(authorizationList)); designer.AddOutput("Number of Authorization Lists"); }
public void Design(IActivityDesigner designer) { designer.AddInput("Advertisement ID").WithDefaultValue("ABC00000"); WqlConnectionManager connection = CMInterop.connectSCCMServer(settings.SCCMSERVER, settings.UserName, settings.Password); using (connection) { String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_Advertisement"); String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" }; foreach (String propertyName in propertyNameChoices) { designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired(); designer.AddInput(propertyName + " : Property Value").NotRequired(); } designer.AddCorellatedData(typeof(advertisement)); designer.AddOutput("Number of Advertisements"); } }
public void Design(IActivityDesigner designer) { designer.AddInput("Package ID").WithDefaultValue("ABC00000"); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); using (connection) { String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_ImagePackage"); String[] propertyTypeChoices = new String[] { "StringValue", "DateTimeValue", "IntegerValue", "BooleanValue" }; foreach (String propertyName in propertyNameChoices) { designer.AddInput(propertyName + " : Property Type").WithListBrowser(propertyTypeChoices).WithDefaultValue("StringValue").NotRequired(); designer.AddInput(propertyName + " : Property Value").NotRequired(); } designer.AddCorellatedData(typeof(imagePackage)); designer.AddOutput("Number of Packages"); } }
public void Execute(IActivityRequest request, IActivityResponse response) { SCCMServer = settings.SCCMSERVER; userName = settings.UserName; password = settings.Password; String objID = request.Inputs["Package ID"].AsString(); String prgName = request.Inputs["Program Name"].AsString(); //Setup WQL Connection and WMI Management Scope WqlConnectionManager connection = CMInterop.connectSCCMServer(SCCMServer, userName, password); try { String[] propertyNameChoices = CMInterop.getSCCMObjectPropertyNames(connection, "SMS_Program"); foreach (String propertyName in propertyNameChoices) { if ((request.Inputs.Contains(propertyName + " : Property Type")) && (request.Inputs.Contains(propertyName + " : Property Value"))) { CMInterop.modifySCCMProgram(connection, objID, prgName, request.Inputs[(propertyName + " : Property Type")].AsString(), propertyName, request.Inputs[(propertyName + " : Property Value")].AsString()); } } IResultObject col = CMInterop.getSCCMProgram(connection, "PackageID LIKE '" + objID + "' AND ProgramName LIKE '" + prgName + "'"); if (col != null) { response.WithFiltering().PublishRange(getObjects(col)); } response.Publish("Number of Programs", ObjCount); } finally { connection.Close(); connection.Dispose(); } }