Get-CMConfigurationItemXMLDefinition

Gets an XML definition of a configuration item in Configuration Manager.

Syntax

Get-CMConfigurationItemXMLDefinition
   [[-Name] <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMConfigurationItemXMLDefinition
   [-Id] <Int32>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMConfigurationItemXMLDefinition
   [-InputObject] <IResultObject>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

The Get-CMConfigurationItemXMLDefinition cmdlet gets an XML definition of a configuration item object as a string. You can specify a configuration item with the configuration item ID, the configuration item name, or using the Get-CMConfigurationItem cmdlet.

Note

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

Examples

Example 1: Get XML formatted item using an ID

PS XYZ:\> Get-CMConfigurationItemXMLDefinition -Id "16777568"

This command gets a configuration item formatted in XML for the item that has the specified identifier.

Example 2: Get XML formatted item using a name

PS XYZ:\> Get-CMConfigurationItemXMLDefinition -Name "ConfigItem76"

This command gets a configuration item formatted in XML for the item named ConfigItem76.

Example 3: Get XML formatted item using a variable

PS XYZ:\> $CIObj=Get-CMConfigurationItem -Id "16777568"
PS XYZ:\> Get-CMConfigurationItemXMLDefinition -InputObject $CIObj

The first command uses the Get-CMConfigurationItem cmdlet to get a configuration item with the specified ID, and then stores it in the $CIObj variable.

The second command gets a configuration item formatted in XML for the item stored in $CIObj.

Parameters

-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

-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

-Id

Specifies an array of IDs of configuration items. You can use a comma-separated list.

Type:Int32
Aliases:CIId, CI_ID
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies a configuration item object. To get a configuration item object, use the Get-CMConfigurationItem cmdlet.

Type:IResultObject
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies an array of names of configuration items. You can use a comma-separated list.

Type:String
Aliases:LocalizedDisplayName
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.String

System.String[]