Cmdlet
Set-OfficeExcelWriteReservation
Sets workbook write-reservation metadata.
Syntax
Set-OfficeExcelWriteReservation [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]#Parameter set:
ContextSet-OfficeExcelWriteReservation [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-Path] <String> [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]#Parameter set:
PathSet-OfficeExcelWriteReservation -Document <ExcelDocument> [-LegacyPasswordHash <String>] [-PassThru] [-Password <String>] [-ReadOnlyRecommended] [-UserName <String>] [<CommonParameters>]#Parameter set:
DocumentExamples
Recommend read-only opening for a shared workbook.
Set-OfficeExcelWriteReservation -Path .\Report.xlsx -ReadOnlyRecommended -UserName 'Reporting Team' -PassThru |
Format-List ReadOnlyRecommended, UserNameWrites Excel file-sharing/write-reservation metadata without encrypting the file or protecting workbook structure.
Parameters
- -LegacyPasswordHash String
- Optional precomputed legacy write-reservation hash.
- -PassThru SwitchParameter
- Emit the updated write-reservation metadata.
- -Password String
- Optional write-reservation password. This is legacy Excel metadata, not package encryption.
- -ReadOnlyRecommended SwitchParameter
- Recommend opening the workbook as read-only.
- -UserName String
- User name stored in the write-reservation metadata.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- 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.