> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/v1.0/usage/cmdlet-reference/save-resource.md).

# Save-Resource

### Description

The `Save-Resource` cmdlet processes pending changes on resource objects obtained from the [New-Resource](/resource-management-powershell/v1.0/usage/cmdlet-reference/new-resource.md), [Search-Resources](/resource-management-powershell/v1.0/usage/cmdlet-reference/search-resources.md), and [Get-Resource](/resource-management-powershell/v1.0/usage/cmdlet-reference/get-resource.md) 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**

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

**Save multiple objects in a single composite operation**

```powershell
# 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**

```powershell
# 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**

```powershell
$obj = Get-Resource AttributeTypeDescription Name DisplayName -Locale it-IT
$obj.DisplayName = "Nome visualizzato"
Save-Resource $obj -Locale it-IT
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lithnet.io/resource-management-powershell/v1.0/usage/cmdlet-reference/save-resource.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
