Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeExcelWriteReservation

Aliases: ExcelWriteReservationSet
Module
PSWriteOffice
Aliases
ExcelWriteReservationSet
Inputs
OfficeIMO.Excel.ExcelDocument

Sets workbook write-reservation metadata.

Syntax

Set-OfficeExcelWriteReservation
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
#
Parameter set: Context
Set-OfficeExcelWriteReservation
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
#
Parameter set: Path
Set-OfficeExcelWriteReservation
-Document <ExcelDocument>
[-LegacyPasswordHash <String>]
[-PassThru]
[-Password <String>]
[-ReadOnlyRecommended]
[-UserName <String>]
[<CommonParameters>]
#
Parameter set: Document

Examples

Recommend read-only opening for a shared workbook.

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.