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

Save-Resource

PreviousGet-ResourceNextSearch-Resources

Last updated 2 years ago

Description

The Save-Resource cmdlet processes pending changes on resource objects obtained from the , , and cmdlets, and submits them to the FIM service.

The Save-Resource cmdlet provides the ability to take objects from the pipeline and save them individually, as well as passing in an array of objects and processing them in a single composite operation.

Syntax

Save-Resource -Resources <PSObject[]> [-Parallel] [-Locale <string>]

Parameters

Resources

One or more resources returned from [New-Resource, [Get-Resource] or [Search-Resources] to save

Parallel

Optional. When this switch is used, the client will perform an update to the resources on multiple threads. It is recommended to pass in an array to the -Resources parameter, which will trigger a composite update instead.

Locale

Optional. Specifies the language code of the culture to save a localized representation of the resource in. This requires the appropriate language packs to be installed on the FIM/MIM Service. e.g en-US, de-de, ja-jp, es-es, it-it.

Examples

Save a single object

$obj = Get-Resource Person AccountName testuser
$obj.DisplayName = "Test User2"
Save-Resource $obj

Save multiple objects in a single composite operation

# Update the Location of multiple objects and save them as a single composite operation
$objs = Search-Resources "/Person[Location='Melbourne']" -AttributesToGet @("Location")
foreach($obj in $objs)
{
     $obj.Location = "Auckland"
}

Save-Resource $objs

Create and save new object

# Create a new resource template for the object type 'Person', populate some attributes, and save the new resource
$obj = New-Resource -ObjectType Person
$obj.AccountName = "newuser"
$obj.ExpiryDate = "2020-01-01T00:00:00.000"
$obj.ObjectSID = "AQUAAAAAAAUVAAAAFYLkaG79nJrWb05iFzcCAA==" #Base 64 encoded value
Save-Resource $obj

Update a localized value for a resource

$obj = Get-Resource AttributeTypeDescription Name DisplayName -Locale it-IT
$obj.DisplayName = "Nome visualizzato"
Save-Resource $obj -Locale it-IT
New-Resource
Search-Resources
Get-Resource