# Set-OfficeExcelWriteReservation

Sets workbook write-reservation metadata. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: ExcelWriteReservationSet

**Module**

`PSWriteOffice`

**Aliases**

`ExcelWriteReservationSet`

**Inputs**

`OfficeIMO.Excel.ExcelDocument`

**Source**

[SetOfficeExcelWriteReservationCommand.cs:17](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Excel/SetOfficeExcelWriteReservationCommand.cs#L17) 

Sets workbook write-reservation metadata.

## Syntax

```
Set-OfficeExcelWriteReservation
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
```

[#](#method-set-officeexcelwritereservation-string-switchparameter-string-switchparameter-string)

Parameter set: `Context`

```
Set-OfficeExcelWriteReservation
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
```

[#](#method-set-officeexcelwritereservation-string-switchparameter-string-string-switchparameter-string)

Parameter set: `Path`

```
Set-OfficeExcelWriteReservation
-Document <ExcelDocument>
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
```

[#](#method-set-officeexcelwritereservation-exceldocument-string-switchparameter-string-switchparameter-string)

Parameter set: `Document`

## Examples

### Recommend read-only opening for a shared workbook.

```powershell
Set-OfficeExcelWriteReservation -Path .\Report.xlsx -ReadOnlyRecommended -UserName 'Reporting Team' -PassThru |
                Format-List ReadOnlyRecommended, UserName
```

Writes Excel file-sharing/write-reservation metadata without encrypting the file or protecting workbook structure.

## Parameters

**-LegacyPasswordHash String optional**

Optional precomputed legacy write-reservation hash.

**-PassThru SwitchParameter optional**

Emit the updated write-reservation metadata.

**-Password String optional**

Optional write-reservation password. This is legacy Excel metadata, not package encryption.

**-ReadOnlyRecommended SwitchParameter optional**

Recommend opening the workbook as read-only.

**-UserName String optional**

User name stored in the write-reservation metadata.

**-Path String requiredposition: 0aliases: FilePath, FullName, InputPathsets: Path**

Workbook path to update.

**-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document**

Open workbook document to update.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:CB569F7B843CDE7D8491E0C9DC372836EFEEFFC0E6CAAB256852B306DF98B264 -->
