Move-CMObject
Move a Configuration Manager object into a different folder.
Syntax
SearchByObjectMandatory (Default)
Move-CMObject
-FolderPath <String>
-InputObject <IResultObject[]>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SearchByIdMandatory
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.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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
.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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:
- Get-CMApplication
- Get-CMPackage
- Get-CMDriverPackage
- Get-CMOperatingSystemImage
- Get-CMOperatingSystemInstaller
- Get-CMBootImage
- Get-CMTaskSequence
Parameter properties
Type: | IResultObject[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
SearchByObjectMandatory
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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
.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | InstanceKey |
Parameter sets
SearchByIdMandatory
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.