Get-CMConfigurationItemXMLDefinition
Get-CMConfigurationItemXMLDefinition
Gets an XML definition of a configuration item in Configuration Manager.
Syntax
Parameter Set: SearchByIdMandatory
Get-CMConfigurationItemXMLDefinition -Id <String[]> [ <CommonParameters>]
Parameter Set: SearchByNameMandatory
Get-CMConfigurationItemXMLDefinition -Name <String[]> [ <CommonParameters>]
Parameter Set: SearchByValueMandatory
Get-CMConfigurationItemXMLDefinition -InputObject <IResultObject> [ <CommonParameters>]
Detailed 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.
Parameters
-Id<String[]>
Specifies an array of identifiers of configuration items. You can use a comma separated list.
Aliases |
CIId |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InputObject<IResultObject>
Specifies a configuration item object. To obtain a configuration item object, use the Get-CMConfigurationItem cmdlet.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String[]>
Specifies an array of names of configuration items. You can use a comma separated list.
Aliases |
LocalizedDisplayName |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get XML formatted item using an ID
This command gets a configuration item formatted in XML for the item that has the specified identifier.
PS C:\> Get-CMConfigurationItemXMLDefinition -Id "16777568"
Example 2: Get XML formatted item using a name
This command gets a configuration item formatted in XML for the item named ConfigItem76.
PS C:\> Get-CMConfigurationItemXMLDefinition -Name "ConfigItem76"
Example 3: Get XML formatted item using a variable
This example gets a configuration item formatted as XML.
The first command gets a configuration item with the specified identifier and stores it in the $CIObj variable.
The second command gets a configuration item formatted in XML for the item in the $CIObj variable.
PS C:\> $CIObj=Get-CMConfigurationItem -Id "16777568"
PS C:\> Get-CMConfigurationItemXMLDefinition -InputObject $CIObj