![無法在 Windows 上以管理員權限存取資料夾](https://rvso.com/image/1568331/%E7%84%A1%E6%B3%95%E5%9C%A8%20Windows%20%E4%B8%8A%E4%BB%A5%E7%AE%A1%E7%90%86%E5%93%A1%E6%AC%8A%E9%99%90%E5%AD%98%E5%8F%96%E8%B3%87%E6%96%99%E5%A4%BE.png)
我在 Windows 10 x64 上遇到資料夾權限問題。無論出於何種原因,我的資料夾權限始終需要「管理員權限才能存取某些資料夾」。當我授予管理員權限時,我收到一條權限被拒絕的訊息。即使擁有管理員權限,如何才能拒絕存取這些資料夾?
另外,如何透過 powershell 遞歸地向目前使用者授予資料夾的安全權限?
答案1
您可以嘗試以下powershell來重設使用者或管理員的權限。
根據Venkatakrishnan
連結中的回答:使用 Powershell 設定 NTFS 權限
$Folderpath='Destination Folder'
$user_account='User Acccount'
$Acl = Get-Acl $Folderpath
$Ar = New-Object system.Security.AccessControl.FileSystemAccessRule($user_account, "FullControl", "ContainerInherit, ObjectInherit", "None", "Allow")
$Acl.Setaccessrule($Ar)
Set-Acl $Folderpath $Acl
希望它可以幫助你。