Remove-Resource

Description

The Remove-Resource cmdlet deletes an object or objects from the FIM Service. The ResourceObjects parameter can be used to pass in an array of resource objects to delete, which will be performed as a single composite request. Note, that if using the pipeline to perform the operation, PowerShell will pass the objects to the cmdlet one at a time, and a composite operation will not be performed.

Syntax

Remove-Resource -ID <object> 
Remove-Resource -ResourceObjects <PSObject[]> 

Parameters

ID

The ID of the object to delete

ResourceObjects

One or more ResourceObjects returned from Get-Resource or Search-Resources to delete

Examples

# Delete a resource by its object ID
Remove-Resource -ID 4107f14e-e73d-479c-87bd-5293d314a260

# Get a Person using its AccountName attribute, and delete it
Get-Resource -ObjectType Person -AttributeName AccountName -AttributeValue testuser | Remove-Resource

# Delete all email templates one at a time
Search-Resources -Xpath "/EmailTemplate" | Remove-Resource

# Delete all email templates as a composite operation
$resources = Search-Resources -Xpath "/EmailTemplate"
Remove-Resource $resources

Last updated