Remove-AzDataLakeGen2AclRecursive cmdlet은 지정된 경로에서 ACL을 재귀적으로 제거합니다.
입력 ACL 항목이 있는 동일한 AccessControlType, DefaultScope 및 EntityId가 있는 원래 ACL의 ACL 항목(다른 사용 권한이 있는 경우에도) wil lbe가 제거되었습니다.
예제
예제 1: 파일 시스템의 루트 디렉터리에서 ACL을 재귀적으로 제거
$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission r-x -DefaultScope
$acl = Set-AzDataLakeGen2ItemAclObject -AccessControlType user -EntityId $id -Permission r-x -InputObject $acl
Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Acl $acl -Context $ctx
WARNING: To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission.
FailedEntries :
TotalDirectoriesSuccessfulCount : 7
TotalFilesSuccessfulCount : 5
TotalFailureCount : 0
ContinuationToken :
이 명령은 먼저 2개의 acl 항목이 있는 ACL 개체를 만든 다음 파일 시스템의 루트 디렉터리에서 ACL을 재귀적으로 제거합니다.
예제 2: 디렉터리에서 재귀적으로 ACL 제거
$result = Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -Context $ctx
WARNING: To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission.
$result
FailedEntries : {dir1/dir2/file4}
TotalDirectoriesSuccessfulCount : 500
TotalFilesSuccessfulCount : 2500
TotalFailureCount : 1
ContinuationToken : VBaHi5TfyO2ai1wYTRhIL2FjbGNibjA2c3RmATAxRDVEN0UzRENFQzZCRTAvYWRsc3Rlc3QyATAxRDY2M0ZCQTZBN0JGQTkvZGlyMC9kaXIxL2ZpbGUzFgAAAA==
$result.FailedEntries
Name IsDirectory ErrorMessage
---- ----------- ------------
dir0/dir2/file4 False This request is not authorized to perform this operation using this permission.
# user need fix the failed item , then can resume with ContinuationToken
$result = Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -ContinuationToken $result.ContinuationToken -Context $ctx
WARNING: To find the ACL Entry to remove, will only compare AccessControlType, DefaultScope and EntityId, will omit Permission.
$result
FailedEntries :
TotalDirectoriesSuccessfulCount : 100
TotalFilesSuccessfulCount : 1000
TotalFailureCount : 0
ContinuationToken :
이 명령은 먼저 디렉터리에서 ACL을 재귀적으로 제거한 다음 실패한 파일을 수정한 후 ContinuationToken으로 다시 시작합니다.
이 스크립트는 청크 크기를 BatchSize * MaxBatchCount로 사용하여 디렉터리 청크에서 재귀적으로 ACL을 제거합니다. 이 스크립트의 청크 크기는 50000입니다.
예제 4: 디렉터리 및 ContinueOnFailure에서 ACL을 재귀적으로 제거한 다음 실패에서 하나씩 다시 시작합니다.
$result = Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path "dir1" -Acl $acl -ContinueOnFailure -Context $ctx
$result
FailedEntries : {dir0/dir1/file1, dir0/dir2/file4}
TotalDirectoriesSuccessfulCount : 100
TotalFilesSuccessfulCount : 500
TotalFailureCount : 2
ContinuationToken : VBaHi5TfyO2ai1wYTRhIL2FjbGNibjA2c3RmATAxRDVEN0UzRENFQzZCRTAvYWRsc3Rlc3QyATAxRDY2M0ZCQTZBN0JGQTkvZGlyMC9kaXIxL2ZpbGUzFgAAAA==
$result.FailedEntries
Name IsDirectory ErrorMessage
---- ----------- ------------
dir0/dir1/file1 False This request is not authorized to perform this operation using this permission.
dir0/dir2/file4 False This request is not authorized to perform this operation using this permission.
# user need fix the failed item , then can resume with ContinuationToken
foreach ($path in $result.FailedEntries.Name)
{
# user code to fix failed entry in $path
#set ACL again
Remove-AzDataLakeGen2AclRecursive -FileSystem "filesystem1" -Path $path -Acl $acl -Context $ctx
}
이 명령은 먼저 ContinueOnFailure가 있는 디렉터리로 ACL을 재귀적으로 제거하고 일부 항목은 실패한 다음 실패한 항목을 하나씩 다시 시작합니다.
Acl을 재귀적으로 변경할 지정된 FileSystem의 경로입니다.
파일 또는 디렉터리일 수 있습니다.
'directory/file.txt' 또는 'directory1/directory2/' 형식입니다.
이 매개 변수를 건너뛰어 Filesystem의 루트 디렉터리에서 Acl을 재귀적으로 변경합니다.
이 cmdlet은 일반적인 매개 변수인 -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction 및 -WarningVariable 매개 변수를 지원합니다. 자세한 내용은 about_CommonParameters를 참조하세요.