Edit

Share via


Get-CMConfigurationItemXMLDefinition

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

Syntax

SearchByNameMandatory (Default)

Get-CMConfigurationItemXMLDefinition
    [[-Name] <String>]
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByIdMandatory

Get-CMConfigurationItemXMLDefinition
    [-Id] <Int32>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByValueMandatory

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.

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

-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

-Id

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:CIId, CI_ID

Parameter sets

SearchByIdMandatory
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

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

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SearchByValueMandatory
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

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

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:LocalizedDisplayName

Parameter sets

SearchByNameMandatory
Position:0
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.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.String

System.String