Jump to content


JustinK

Creating Software Update Deployment Packages from PowerShell

Recommended Posts

Hey All.

 

I've been working on an otherwise simple runbook in Orchestrater that gathers all the auto deployment rules, checks their associated Deployment Package that they download updates to, and updates said packages to the correct "year" to help alleviate that otherwise annoying manual process of maintaining Update package sizes.

 

I ran into a final problem however: when it's time to create a "new" software update package I can't figure out any way to do it form the command line. Creating a new one from the GUI seems to only be doable by editing an existing or creating a new ADR. However, if I try to use New-CMSoftwareUpdateAutoDeploymentRule the only flag I can seem to use is -DeploymentPackageName which requires the package to have already been created.

 

More frustrating is that trying to query the cmdlets directy to manipulate the packages:

 

get-CMSoftwareUpdateDeploymentPackage

set-CMSoftwareUpdateDeploymentPackage

remove-CMSoftwareUpdateDeploymentPackage

 

huh ... no add ... no new .... no "start" even.

 

Is there anyway to create these things systematically? Perhaps even with a WMI call? My goal is to setup soem runbooks that query the current year and possibly current size of the packages and create new deployment packages when certain size limits are hit. Most of it was easy ... this last it is ... annoying.

Share this post


Link to post
Share on other sites

Bah .. sometimes the right Google query answers the question. Those curious we can make them with a WMI query:

 

$Arguments = @{Name = $Name;Description = $Description;PkgSourceFlag = 2;PkgSourcePath = $Source}

Set-WmiInstance -Namespace "Root\SMS\Site_$SiteCode" -Class SMS_SoftwareUpdatesPackage -Arguments $Arguments -ComputerName $SiteServer -ErrorAction STOP

 

In the above string I'm using variables for Name, Description, and Source Directory, as well as Site Server and site code. Now I just have to distribute that package and I'm good to go. Home stretch here I come!

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.