Export-CMCollection

Exports a collection.

Syntax

Export-CMCollection
      -CollectionId <String>
      -ExportFilePath <String>
      [-ExportComment <String>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Export-CMCollection
      -InputObject <IResultObject>
      -ExportFilePath <String>
      [-ExportComment <String>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Export-CMCollection
      -Name <String>
      -ExportFilePath <String>
      [-ExportComment <String>]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Export-CMCollection cmdlet saves a collection object to a specified MOF file in Microsoft System Center Configuration Manager.

Examples

Example 1: Export a collection by name

PS C:\> Export-CMCollection -Name "testUser" -ExportFilePath "C:\collection.mof"

This command exports the collection named testUser to the file named collection.mof.

Example 2: Get a collection object and export it

PS C:\> Get-CMCollection -Name "testUser" | Export-CMCollection -ExportFilePath "C:\collection.mof"

This command gets the collection object named testUser and uses the pipeline operator to pass the object to Export-CMCollection, which exports the object to the file named collection.mof.

Required Parameters

-CollectionId

Specifies a collection ID. If you do not specify a collection, all collections in the hierarchy are exported.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ExportFilePath

Specifies the full path for the export file. The file name must end in ".mof".

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a collection object. To obtain a collection object, use the Get-CMCollection cmdlet.

Type:IResultObject
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a collection. If you do not specify a collection, all collections in the hierarchy are exported.

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

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

Specifies a comment for the exported collection.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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