MECM - Get-CMSoftwareUpdateAutoDeploymentRule

Love Arvidsson 116 Reputation points


Im working on some scripting with "Get-CMSoftwareUpdateAutoDeploymentRule" & "New-CMSoftwareUpdateAutoDeploymentRule" and ran into some problem when trying to figure out how to copy "UpdateClassification" & "Severity" properites from one rule to the next.

When you use the Get-cmdlt you would be returned the follwing values for eg Severity:


And for "_UpdateClassification":

When you use "New"-Cmdlet these properties needs to be specified as strings, eg "Critical" for severity, and "Critical Updated" for _UpdateClassification.

Just thought i would check if there is some easy way to "convert" these into a usable stringvalue to be used with "New-", like you can do with "_Products" (Using the ID returned with "Get-CMSoftwareUpdateCategory" to get the ProductName) or do i just have to start working on some more code to get this done ^^

Thank you,
Best regards!

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,407 questions
Microsoft Configuration Manager Updates
Microsoft Configuration Manager Updates
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Updates: Broadly released fixes addressing specific issue(s) or related bug(s). Updates may also include new or modified features (i.e. changing default behavior).
981 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. HanyunZhu-MSFT 1,841 Reputation points

    Hi @Love Arvidsson ,

    Thanks for posting in Microsoft Q&A forum.

    To this issue, we could set these properties as variables, and fill in the variables in the new rule.

    For example,

    $a = ((get-cmdlt).property1).tostring()  
    $b = ((get-cmdlt).property2).tostring()  
    new-cmdlet -para1 $a, -para2 $b, -para3 "abc", -para4 $false  

    For more information about use new-cmdlet to create an automatic deployment rule (ADR) for software updates, please refer to:
    We could find some examples in this link and use them as references.

    Hope the above information can help you.

    If the response is helpful, please click "Accept Answer"and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.