Resource Management Powershell
Documentation Home
  • Home
  • Installation
    • Installing the PowerShell module
  • Configuration
    • Configuration management
    • ConfigSync File
    • Variables File
      • <Variables> element
        • <Variable> element
    • <Operations> element
      • <ResourceOperation> element
      • <AnchorAttributes> element
      • <AnchorAttribute> element
      • <AttributeOperations> element
        • <AttributeOperation> element
    • Building references
  • Usage
    • Cmdlet reference
      • Set-ResourceManagementClient
      • Get-Resource
      • Save-Resource
      • Search-Resources
      • Search-ResourcesPaged
      • Remove-Resource
      • New-Resource
      • Update-ResourceManagementClientSchema
      • Import-RMConfig
      • New-XPathQuery
      • New-XPathQueryGroup
      • New-XPathExpression
      • Get-ApprovalRequest
      • Set-PendingApprovalRequest
  • help and support
    • Quick reference guide
    • Working with different data and attribute types
    • XPath expression examples
Powered by GitBook
On this page
  • Description
  • Syntax
  • Parameters
  • Examples
  1. Usage
  2. Cmdlet reference

Remove-Resource

PreviousSearch-ResourcesPagedNextNew-Resource

Last updated 2 years ago

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 or 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
Get-Resource
Search-Resources