powershellsccmconfigurationmanager

Moving Applications in SCCM


new here but have been using the site a long time. I am trying to create a powershell script so i can automate the google chrome updates I do I am unable to get the application to create in the right folder. And i am not able to move it to the right folder either. it keeps telling me that the folder is invalid. the code I am using is

$App = get-cmapplication -name "Google Test_Test"
$FolderPath = "\3rd Party\Google Chrome\"
Move-CMObject -ObjectId $App.CI_ID -FolderPath $FolderPath

The path of where I want to put them in the SCCM console is correct according to the current object in the container\folder so I am at a bit of a loss.

Any help would be greatly appreciated

I have run the code and changed the path to other variations included the site code etc but still not working.


Solution

  • According to the documentation, -FolderPath:

    Specifies a destination folder path, in the following format: <site code>:\<object type>\folder\subfolder\subfolder.

    So try that:

    $App = Get-CMApplication 'Google Test_Test'
    $SiteCode = 'SC1' # replace with your actual site code
    
    $App |Move-CMObject -FolderPath "${SiteCode}:\Application\3rd Party\Google Chrome"