ConfigMgr 2012 Script to retrieve source path locations

Here’s a PowerShell script we recently wrote to show the source path location for all the content that we put into ConfigMgr. The Script lists all the content source paths for the following CM objects.

  • Applications
  • Driver Packages
  • Drivers
  • Boot Images
  • OS Images
  • Software Update Package Groups
  • Packages

The output is as shown in the example below.

CMDATASOURCE

before executing the script, connect to your site.

Thanks to Claude Henchoz for helping me out with the the Applications function.

11 thoughts on “ConfigMgr 2012 Script to retrieve source path locations

  1. I realize that this post is almost a year old but what version of SCCM 2012 did you write this against? R2, SP1, etc? I’m asking because I tried running this against our SP1 install and ($Application.SDMPackageXML).AppMgmtDigest returns nothing.

  2. I’m getting a lot of errors when trying to run the above powershell script. Syntax errors, like, “Missing ‘)’ in method call”, and “Missing closing ‘}'”, stuff like that. I’m trying to run this on Server 2012 w/SCCM 2012R2. Is there something I’m doing wrong?

  3. Had the same problem as Matt; looks like the text of script changes a single quote ‘ to ".
    Find " and replace with ‘ (there are a lots of them!) and all will be OK. And running it on 2012R2 with SP1 + CU1, so ‘latest’ works OK.
    Nice script though otherwise. Thanks!

  4. OK, don’t you just love how a page changes what you put? The text to find is & (ampersand) quot ; (semi-colon) without any spaces…

  5. Hi guys,

    I still cannot get the script to run…

    There is no singel ( ‘ ) or double ( ” ) quotes to find.

    What do I need to change to make the script run?

  6. “The text to find is & (ampersand) quot ; (semi-colon) without any spaces…”

    What does that mean?

    Clearly the person who posted this blog was too lazy to simply upload a text file to a storage site, so people dont have to mess around trying to account for all the issues that this bloging website cause with scripts.

    Can someone please clarify what is needed to make this script work????

    Here is the array of errors it causes:

    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:53
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    Missing ‘)’ in method call.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:53
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    Unexpected token ‘&’ in expression or statement.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:53
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    Missing closing ‘)’ in expression.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:63
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
    quotation marks (“&”) to pass it as part of a string.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:124 char:82
    + … .Content.File) {
    + ~
    Missing closing ‘}’ in statement block.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:120 char:62
    + foreach ($DeploymentType in $AppMgmt.DeploymentType) {
    + ~
    Missing closing ‘}’ in statement block.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:115 char:49
    + foreach ($Application in Get-CMApplication) {
    + ~
    Missing closing ‘}’ in statement block.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:113 char:30
    + function GetInfoApplications {
    + ~
    Missing closing ‘}’ in statement block.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:69
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    Unexpected token ‘)’ in expression or statement.
    At F:\SOFTWARE\_Non Packaged Software\SCCM\Scripts\Export_ALL_Content.ps1:125 char:70
    + $size += [int]($MyFile.GetAttribute("Size"))
    + ~
    Unexpected token ‘)’ in expression or statement.
    Not all parse errors were reported. Correct the reported errors and try again.
    + CategoryInfo : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

  7. What a wonderful script! Worked like a charm on my SCCM 2012 R2 SP1 CU3. The only thing that you need is to Find&Replace " with ‘

    If someone could improve the script to format output as a table to simply insert in Excel and filter, that would be really appreciated. Currently when I insert its output in Excel, it puts everything in the same first column.

Leave a Reply

Your email address will not be published. Required fields are marked *