Move-CMObject

Move a Configuration Manager object into a different folder.

Syntax

Move-CMObject
    -FolderPath <String>
    -InputObject <IResultObject[]>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Move-CMObject
    -FolderPath <String>
    -ObjectId <String[]>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Move-CMObject cmdlet moves a Configuration Manager object into a different folder. Specify the object to move and the destination folder. Because an object exists in only one folder, the cmdlet doesn't specify the current folder.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Move an app by object

This example first gets an application object by name. It then moves the object to the folder TestFolder.

$app = Get-CMApplication -Name "Teams"
Move-CMObject -FolderPath "XYZ:\Application\TestFolder" -InputObject $app

Example 2: Move a task sequence by ID

This example moves the task sequence with package ID XYZ00550 to the Development folder.

Move-CMObject -FolderPath "XYZ:\TaskSequence\Development" -ObjectId "XYZ00550"

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FolderPath

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

  • <site code>: The Configuration Manager site code.
  • <object type>: One of the following keywords for the type of object to move:
    • Application
    • BootImage
    • ConfigurationBaseline
    • ConfigurationItem
    • DeviceCollection
    • Driver
    • DriverPackage
    • OperatingSystemImage
    • OperatingSystemInstaller
    • Package
    • Query
    • TaskSequence
    • UserCollection
    • UserStateMigration

For example, a folder named LOB Apps for an application at the site CM1 has the following file path: CM1:\Application\LOB Apps.

To move an object to the root folder, don't specify a folder. For example, CM1:\Application.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specify an array of Configuration Manager objects to move. If you specify an array, use the same object type. Match the object type with the keyword used with the -FolderPath parameter.

Use one of the following cmdlets to get these objects:

Type:IResultObject[]
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ObjectId

Specifies an array of object IDs to move. If you specify an array, use the same object type. Match the object type with the keyword used with the -FolderPath parameter.

For example, XYZ00550.

Type:String[]
Aliases:InstanceKey
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject[]

Outputs

System.Object