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 IDs 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 get 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
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.
PS C:\> $CIObj=Get-CMConfigurationItem -Id "16777568"
PS C:\> Get-CMConfigurationItemXMLDefinition -InputObject $CIObj