你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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:\> Set-AIPFileLabel C:\Projects\Analysis.docx -RemoveProtection -RemoveLabel -JustificationMessage 'The previous label no longer applies'

FileName                   Status Comment
--------                   ------ ------------
C:\Projects\Analysis.docx  Success

此命令从名为 Analysis.docx的单个文件中删除标签和自定义保护。 由于策略配置为需要理由来删除标签,因此还提供了理由原因,以便命令可以完成,而无需提示用户说明原因。

参数

-JustificationMessage

如果敏感度标记策略要求用户提供此信息,则删除标签或删除保护的理由。 如果删除标签触发了理由,并且未提供此原因,则不会删除标签。 在这种情况下,返回的状态为“已跳过”,同时会返回备注“需要理由”。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

指定要删除其标签和保护信息的文件的本地路径、网络路径或 SharePoint Server URL。

不支持通配符,也不支持 WebDav 位置。

对于 SharePoint 路径,支持以下各项:

  • SharePoint Server 2022
  • SharePoint Server 2019
  • SharePoint Server 2016
  • SharePoint Server 2013

例如:

使用引号将路径值括起来时,路径可以包含空格。

Type:String[]
Aliases:FullName, FileName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PreserveFileDetails

指定此参数可将修改日期保留 (Windows 和 SharePoint) ,并由 (SharePoint 修改的日期) 标记文档的值保持不变:

  • 对于本地或网络文件, “修改日期” 值保持不变。

  • 对于 SharePoint 文件, “修改日期” 和“ 修改者” 值保持不变。

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemoveLabel

删除已应用于文件的任何标签。

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RemoveProtection

从文件中删除保护。 如果文件已标记,则不会删除标签。

你必须拥有足够的使用权限或成为你的组织的超级用户,才能从文件中删除保护。 有关详细信息,请参阅 为 Azure Rights Management 和发现服务或数据恢复配置超级用户

使用 Remove-FileLabel PowerShell cmdlet 可从容器文件中删除保护, (zip.rar.7z.pst) 。

注意

  • 默认情况下,此删除保护功能处于禁用状态,必须先使用 Set-LabelPolicy cmdlet 启用。

  • 对于 .pst 文件,5 GB 是此 cmdlet 支持的最大文件大小。

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

输入

System.String[]

输出

Microsoft.InformationProtection.Powershell.AIP.Results.SetAIPFileResult