Export-CMCollection

Exports a collection.

Syntax

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

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
Required:True
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
Required:True
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
Required:True
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
Required:True
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Specifies a comment for the exported collection.

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

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False