1

以Windows 2008 R2服務器上的管理員身份導航到C:\Users\%SomeUsername%時,出現錯誤You don't currently have permission to access this folder,Click Continue to permanently get access to this folder。點擊Continue可以解決這個問題。解決PowerShell中「您當前沒有權限訪問此文件夾」的問題

如果我嘗試使用PowerShell(例如get-childitem 'C:\Users\' -Directory | get-childitem -Force;或其他變體),我還沒有向其授予訪問權限的任何配置文件明確給出錯誤Access to the path 'C:\Users\%SomeUsername%' is denied.;即使包含了Force開關。

有沒有辦法通過PowerShell「點擊繼續」即讓系統允許我訪問任何我沒有嚴格訪問的內容,但是由於服務器上的管理員可以授予我訪問權限的權限。理想情況下,這可以在我訪問文件時完成(例如通過Get-Item命令中的開關),而不必編寫代碼來明確檢查和修改權限。

回答

2

確保有關啓動Powershell的以管理員​​身份運行,如果你想一直運行它以管理員身份從powershell.exe做出快捷方式,並按照這一形象: enter image description here

0

我的錯誤;我沒有以管理員身份運行PowerShell會話(即UAC)。

  • 上powershell.exe
  • 運行右鍵以管理員身份
相關問題