none
Update Content in DeploymentType for an Application C#

    Question

  • Hi,

    I am looking for a method to update the content so that sccm will get the new files from the source location and updates the new revision in all the assigned DP's

    Via Console we can do this by right clicking on the "Deployment Type" and then click the "Update Content"

    I am thinking there should be a method or property in "DeploymentType" or "ScriptInstaller" class but I dint find any thing.

    Any one have any idea on this?

    Thanks,



    Saturday, September 28, 2013 6:01 PM

All replies

  • Sunday, September 29, 2013 5:17 PM
  • Thanks Torstoen,

    I am coding in C# so looking for c# code not the Powershell Cmdlet

    I found that we have to call a method called "RefreshPkgSource" in "SMS_ContentPackage" class to update the content but not sure what is going on I am getting an exception "You do not have security rights to perform this operation."  but I do have rights to do that from SCCM Console Application Management.

    string PackageID="P0000161";

    IResultObject objSMSContentPackage = Connection.GetInstance(@"SMS_ContentPackage.PackageID='" + PackageID + "'"); Dictionary<string, object> emptyparams = new Dictionary<string, object>(); objSMSContentPackage.Get(); objSMSContentPackage.ExecuteMethod("RefreshPkgSource", emptyparams);

    I am getting the below exception while Executing the "RefreshPkgSource" method.

    Description = "User \"****\\******\" does not have permissions to modify packages.";  //***removed my account name hare
     ErrorCode = 1112017920;
     File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssppackage.cpp";
     Line = 2547;
     ObjectInfo = "2";
     Operation = "ExecMethod";
     ParameterInfo = "SMS_ContentPackage.PackageID=\"P0000161\"";
     ProviderName = "WinMgmt";
     StatusCode = 2147749889;


    Sunday, September 29, 2013 5:36 PM
  • any one have any idea about this ? Am I doing some thing wrong in the above code while calling the "RefreshPkgSource" method ?

    Wednesday, October 02, 2013 4:50 AM