【问题标题】:Delete ACL entry from the manage ACL list of the storage account in Azure using PowerShell使用 PowerShell 从 Azure 中存储帐户的管理 ACL 列表中删除 ACL 条目
【发布时间】:2021-12-21 07:09:29
【问题描述】:

对于特定目录/文件夹,有提供权限的 ACL 列表。要求是从管理访问控制列表中删除特定的 ACL 条目。

以下命令仅有助于删除 ACL 的权限。但该条目仍会出现在管理访问控制列表中

$filesystemName = "my-container"
$userID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $userID -Permission "---"
Remove-AzDataLakeGen2AclRecursive -Context $ctx -FileSystem $filesystemName  -Acl $acl

您能否帮助我们使用 PowerShell 命令删除条目..?

【问题讨论】:

  • 你在哪里不删除它?
  • 理想情况下,应从存储帐户的管理访问控制列表中删除该条目。删除命令只会使权限为空。实体/ACL 仍将出现在列表中

标签: azure powershell azure-devops azure-active-directory azure-storage


【解决方案1】:

试试这个从 ACL 列表中清除条目的示例

$id = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

# Create the new ACL object.
[Collections.Generic.List[System.Object]]$aclnew =$acl

foreach ($a in $aclnew)
{
    if ($a.AccessControlType -eq "User"-and $a.DefaultScope -eq $false -and $a.EntityId -eq $id)
    {
        $aclnew.Remove($a);
        break;
    }
}
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName -Path $dirname -Acl $aclnew

更多详情请参考此文档:https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-acl-powershell

【讨论】:

  • 这种方法的输出也相同。基本上权限已被删除,或者可以被告知它会更改为 (---) 但 AD 组条目仍将出现在管理访问控制列表中。
  • 你能展示一下输出的样子吗?
猜你喜欢
  • 2017-06-20
  • 2021-09-21
  • 2021-02-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-19
  • 1970-01-01
  • 2017-05-17
  • 1970-01-01
相关资源
最近更新 更多