locked
Export and Import members of a Software Update Group RRS feed

  • Question

  • Greetings,

    I am looking for a method I can use to Export a Software Update Group (or just it's members) to a file that I can then use to Import into another 2012 hierarchy. I can't use the built-in Migration process as it is already connected to a different Hierarchy.

    I have scripts that will pull Approvals from WSUS and then import into Update groups, but I also need something that I can use to copy update groups from "DEV" to "PROD" and back again.

    Any thought or suggestions most welcome.

    Scott.

    Tuesday, June 10, 2014 8:11 AM

Answers

  • Hi

    You cannot export Software Update Groups in ConfigMgr 2012.

    One way of doing what you what is to use Powershell to "dump" all the settings of your Software Update Groups and then use that file as a basis for creating the Software Update Group in production. Or you could just create all Software Update Groups using a Powerscript which runs in dev and production.

    To get you started, you could look at the snippet of code below, which I use for creating Software Update Group automatically.

    import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
    $PSD = Get-PSDrive -PSProvider CMSite
    CD "$($PSD):"
    
    $DPDate = get-date "22-02-2011 19:00:00"
    $SUGName = "Workstaitions 2011 02 February"
    $SUGMembers = Get-CMSoftwareUpdate | Where-Object {$_.DatePosted -eq $DPDate -and $_.NumMissing -ge 1} | select CI_ID
    New-CMSoftwareUpdateGroup -Name $SUGName -UpdateId $SUGMembers.CI_ID

    • Proposed as answer by Joyce L Wednesday, June 11, 2014 7:10 AM
    • Marked as answer by Scott Williams - IP1 Thursday, June 12, 2014 11:27 PM
    Tuesday, June 10, 2014 8:28 AM

All replies

  • Hi

    You cannot export Software Update Groups in ConfigMgr 2012.

    One way of doing what you what is to use Powershell to "dump" all the settings of your Software Update Groups and then use that file as a basis for creating the Software Update Group in production. Or you could just create all Software Update Groups using a Powerscript which runs in dev and production.

    To get you started, you could look at the snippet of code below, which I use for creating Software Update Group automatically.

    import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
    $PSD = Get-PSDrive -PSProvider CMSite
    CD "$($PSD):"
    
    $DPDate = get-date "22-02-2011 19:00:00"
    $SUGName = "Workstaitions 2011 02 February"
    $SUGMembers = Get-CMSoftwareUpdate | Where-Object {$_.DatePosted -eq $DPDate -and $_.NumMissing -ge 1} | select CI_ID
    New-CMSoftwareUpdateGroup -Name $SUGName -UpdateId $SUGMembers.CI_ID

    • Proposed as answer by Joyce L Wednesday, June 11, 2014 7:10 AM
    • Marked as answer by Scott Williams - IP1 Thursday, June 12, 2014 11:27 PM
    Tuesday, June 10, 2014 8:28 AM
  • Thanks Michael,

    That Powershell approach is was I was looking for, everything I had seen before was related to CM2007 using WMI queries and direct database writes. I'll give that a go as I think it will effectively help do what I need.

    The "dump" is effectively doing an export of the memberlist, so while I know there is no native export function, I may look at making it a "right-click" extension to bring it into the console GUI

    Wednesday, June 11, 2014 12:12 AM
  • In the end we've gone with a slightly more comprehensive approach. Using a SQL query that compares the members of the update groups between the two (ultimately it will be 4) Hierarchies, pulls out the CI_ID of whatever is missing and we then use a Powershell script using New-CMSoftwareUpdateGroup and Add-CMSoftwareUpdateToGroup. All that will be run using Orchestrator to automate the process of keeping it all in sync.

    I tried doing it all in Powershell, but the cmdlets all use CI_ID value, but you need to use CI_UniqueID to match updates between servers first. In the end a direct SQL comparison to get the required CI_ID values was quicker and easier.

    Friday, June 13, 2014 4:44 AM