Remove-FileLabel
删除文件的敏感度标签,或根据标签配置或自定义权限删除保护。
语法
Remove-FileLabel
[-Path] <String[]>
[-JustificationMessage <String>]
[-RemoveLabel]
[-PreserveFileDetails]
[<CommonParameters>]
Remove-FileLabel
[-Path] <String[]>
[-JustificationMessage <String>]
[-RemoveLabel]
[-RemoveProtection]
[-PreserveFileDetails]
[<CommonParameters>]
Remove-FileLabel
[-Path] <String[]>
[-JustificationMessage <String>]
[-RemoveProtection]
[-PreserveFileDetails]
[<CommonParameters>]
说明
对于 Microsoft Purview 信息保护客户端, Remove-FileLabel cmdlet 删除一个或多个文件的敏感度标签。
示例
示例 1:从文件中删除标签
PS C:\> Remove-FileLabel C:\Projects\Analysis.docx -RemoveLabel -JustificationMessage 'The previous label no longer applies'
FileName Status Comment
-------- ------ ------------
C:\Projects\Analysis.docx Success
此命令从名为 C:\Projects\Analysis.docx的文件中删除现有标签,并指定强制理由消息。
此理由方法是必需的,因为启用了相关的敏感度标签策略设置以要求删除标签的理由。
注释
如果要删除的标签是使用模板保护文件,此命令将同时删除标签和保护。
如果要删除的标签是使用自定义权限保护文件,此命令仅删除标签。
示例 8:从文件中删除保护
PS C:\> Remove-FileLabel C:\Projects\Analysis.docx -RemoveProtection
FileName Status Comment
-------- ------ ------------
C:\Projects\Analysis.docx Success
此命令从名为 Analysis.docx的单个文件中删除保护。
示例 9:从文件中删除保护和标签
PS C:\> Remove-FileLabel C:\Projects\Analysis.docx -RemoveProtection -RemoveLabel -JustificationMessage 'The previous label no longer applies'
FileName Status Comment
-------- ------ ------------
C:\Projects\Analysis.docx Success
此命令从名为 Analysis.docx的单个文件中删除标签和自定义保护。 由于策略配置为要求理由删除标签,因此还提供了理由原因,以便命令可以完成,而无需提示用户原因。
参数
-JustificationMessage
如果敏感度标签策略要求用户提供此信息,则删除标签或删除保护的理由。 如果删除标签会触发理由,并且未提供此原因,则不会删除标签。 在这种情况下,返回的状态为“跳过”,注释为“必需理由”。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Path
指定要删除标签和保护信息的文件的本地路径、网络路径或 SharePoint Server URL。
不支持通配符,也不支持 WebDav 位置。
对于 SharePoint 路径,支持以下各项:
- SharePoint Server 2022
- SharePoint Server 2019
- SharePoint Server 2016
- SharePoint 服务器 2013
例如:
- C:\Folder\
- C:\Folder\Filename
- \\Server\Folder
http://sharepoint.contoso.com/Shared%20Documents/Folder
使用引号将路径值括起来时,路径可以包含空格。
类型: | String[] |
别名: | FullName, FileName |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-PreserveFileDetails
指定此参数以保留修改日期(Windows 和 SharePoint),并按 (SharePoint) 值修改标签的文档保持不变:
对于本地或网络文件, 修改日期 的值保持不变。
对于 SharePoint 文件, “修改日期 ”和 “修改值 ”保持不变。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-RemoveLabel
删除已应用于文件的任何标签。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-RemoveProtection
从文件中删除保护。 如果文件已标记,则不会删除标签。
你必须具有足够的使用权限,或者是组织要从文件中删除保护的超级用户。 有关详细信息,请参阅 为 Azure Rights Management 和发现服务或数据恢复配置超级用户。
使用 Remove-FileLabel PowerShell cmdlet 从容器文件(zip、 .rar、 .7z 和 .pst)中删除保护。
注释
默认情况下禁用此删除保护功能,必须先使用 Set-LabelPolicy cmdlet 启用此功能。
对于 .pst 文件,5 GB 是此 cmdlet 支持的最大文件大小。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
输入
System.String[]
输出
Microsoft.InformationProtection.Powershell.AIP.Results.SetAIPFileResult