Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Unprotect-OfficeDocument

Module
PSWriteOffice
Inputs
System.Object System.String[]
Outputs
System.IO.FileInfo OfficeIMO.Word.WordDocument OfficeIMO.Excel.ExcelDocument OfficeIMO.PowerPoint.PowerPointDocument OfficeIMO.Pdf.PdfDocument

Removes native package encryption or selected editing restrictions.

Syntax

Unprotect-OfficeDocument
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Restriction <OfficeProtectionRestriction[]>]
[<CommonParameters>]
#
Parameter set: Path
Unprotect-OfficeDocument
-LiteralPath <String[]>
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[-Password <SecureString>]
[-Restriction <OfficeProtectionRestriction[]>]
[<CommonParameters>]
#
Parameter set: LiteralPath
Unprotect-OfficeDocument
[-Document] <Object>
[-Options <Object[]>]
[-OutputPath <String>]
[-PassThru]
[-Password <SecureString>]
[-Restriction <OfficeProtectionRestriction[]>]
[<CommonParameters>]
#
Parameter set: Document

Examples

Example 1

Unprotect-OfficeDocument -Path @('C:\Path')

Example 2

Unprotect-OfficeDocument -Document 'Value'

Example 3

Unprotect-OfficeDocument -LiteralPath @('C:\Path')

Parameters

-Options Object[] optional
Native source policy options; PDF accepts its bounded load settings.
-OutputPath String optional
Write one copy; omission saves to the associated path when available.
-PassThru SwitchParameter optional
Emit the saved file or caller-owned/native replacement model.
-Password SecureString optional
Current open password, or PDF owner password for removing Standard security.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path
Input paths; supports wildcards.
-Restriction OfficeProtectionRestriction[] optional
Remove only these restrictions; omission also removes package encryption.
Possible values: ReadOnly, Comments, TrackedChanges, Forms, Structure, Windows, ReadOnlyRecommended, Print, Copy, Modify, Annotate, FillForms, Assemble
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Exact input paths.
-Document Object requiredposition: 0pipeline: True (ByValue)sets: Document
Caller-owned native model.

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.