My PowerShell + ConfigMgr posts

Collection of all my ConfigMgr + PowerShell posts, because :

Below pic says it all 





Realized I should do a getting started series for #PowerShell + #SCCM:


  1. PowerShell + SCCM 2012 : Get Started with CM Cmdlets  [PSBUG : Hangout Video @Youtube]
  2. PowerShell + WMI : Static & Instance Methods
  3. PowerShell + SCCM 2012 : Boundaries
  4.  PowerShell + SCCM 2012 R2 : Create Folders to organize 
  5. PowerShell + WMI Hangout with Stephane Van Gulick
  6. PowerShell + ConfigMgr : KickStart (Video Recording for PoSHBreakfast]
  7. PowerShell + SCCM : WMI Scripting
  8. PowerShell + SCCM : Run Configmgr cmdlets remotely



Rest of the posts:

  1.  PowerShell + SCCM 2012  R2 Installation
  2.  PowerShell + SCCM 2012 R2 - Discovery
  3. Use PowerShell to Remove Packages in Bulk from DP (independent of the ConfigMgr PS Module)
  4. PowerShell + SCCM 2012 - Extending Discovery
  5. PowerShell + SCCM 2012 R2 : Adding Roles & Client Settings (Device & User) 
  6. PowerShell + SCCM 2012 R2 : Client Push Installation 
  7. PowerShell + SCCM 2012 R2 : Create an Application (from MSI) & Deploy it
  8. PowerShell + SCCM 2012 R2 : Deploy PowerShell Scripts
  9. PowerShell + SCCM 2012 R2: Get the Client Info Easy Way
  10.  PowerShell + SCCM 2012 R2: Get the Device/ User Info WMI Way 
  11. PowerShell + SCCM Tip: Get MachineName for a User
  12. PowerShell + SCCM 2012 Tip : Get OS Inventory
  13. PowerShell + SCCM 2012 : Create Supersedence Rule
  14. PowerShell + SCCM 2012 : Create Dependency Rules
  15. PowerShell + SCCM 2012 : Automate Patching
  16. PowerShell + SCCM 2012 : Get-DPContent
  17. PowerShell + SCCM : POSH Deploy (Tool to automate Query Based deployments)
  18. PowerShell + SCCM 2012 : Create Packages and Programs

4 comments:

  1. Hi DexterPOSH,
    at first I want to say thank you for all those great guides!
    And secondly I'd like to ask you a question as follows:
    In our SCCM environment we have alot of applications that frequently get updated. As we want to use the application-catalogue, we enter data into the catalog, which we'd like to re-use.
    We come across a problem, which we seemingly can't solve. We want to extract the CatalogCategories in human readable or at least in a form that can be passed through powershell to sccm.

    Set-Cmapplication -Name "x" -usercategory "Usercategory1","Usercategory2"

    All I get from
    [XML]$SDMPackageXML=Get-CMApplication -name "application" | select SDMPackageXML -expandproperty SDMPackageXML
    $SDMPackageXML.AppMgmtDigest.Application.DisplayInfo.Info.UserCategories

    result will be some catalog IDs such as
    {CatalogCategories:12345678-9abc-def0-1234-56789abcdef0, CatalogCategories:12345678-9abc-def0-1234-56789abcdef1}

    I can't find a way to use this ID without running a statement directly to the database, which I would like to avaoid.
    How can I get the Catalog Categories or how can I pass those ID's to add the categories to an application?

    ReplyDelete
    Replies
    1. Hi there,
      I am glad that these posts are helpful for you.

      With the problem you have at hand, first thing that comes to my mind is look for the CIM/WMI class that corresponds to the categories in the ConfigMgr, once you have that you can correlate those Catalog Ids to the localized name for the category and re-use it.

      Let me know, if this does not work. I can give it a shot sometime.

      ~Dex~

      Delete
    2. Well, the WMI would definitly empower us to extract the human-readable names. The solution I chose now is a Cmdlet I did not know existed, although it obviously is present in the reference.
      ########################
      $HumanReadableCategory=Get-CMCategory -Id 12345678-9abc-def0-1234-56789abcdef0 | select LocalizedCategoryInstanceName -ExpandProperty LocalizedCategoryInstanceName
      ########################
      This translates the ID into human-readable and is returnable to this Cmdlet:
      ########################
      Set-CMApplication -NAME "SoftwareName" -UserCategory $HumanReadableCategory
      ########################

      This enables us to extract catalog information from older versions and add them to the new ones.
      I even added the possibility to extract existing deployments and to add them to new versions. This was not possible without WMI by the way.

      $Deployments=Get-WmiObject -ComputerName "..." -Namespace "..." -Query "SELECT * FROM SMS_DeploymentInfo WHERE TargetName = '$oldsoftwarename'"
      where I need to extract the Collectionname and DeploymentIntent (0 stands for required and 2 for available)
      Those information get utilized in this Cmdlet:
      Start-CMApplicationDeployment -CollectionName ... -Purpose ... [...]

      The next step for me, will be, to add the possibility to supersede the old software version with the new one, utilizing some commands from your Blog entry about supersedence.

      In the end we will be able to replace old software versions with new ones, adding the catalog data ,deployments and supersedence rules to the new Version.

      Delete
    3. Nice,you figured it out.
      You are doing some neat work, maybe blog about it so that people benefit from what you are doing :)

      Delete