[英]Working around the "You don't currently have permission to access this folder" issue for PowerShell
When navigating to C:\\Users\\%SomeUsername%
as an administrator on a Windows 2008 R2 server I get the error You don't currently have permission to access this folder
, Click Continue to permanently get access to this folder
.在 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
。 Clicking Continue
resolves this problem.单击Continue
可解决此问题。
If I try the same by PowerShell (eg get-childitem 'C:\\Users\\' -Directory | get-childitem -Force
; or some variant), any profiles to which I've not already granted myself access explicitly give the error Access to the path 'C:\\Users\\%SomeUsername%' is denied.
如果我通过 PowerShell 尝试相同的操作(例如get-childitem 'C:\\Users\\' -Directory | get-childitem -Force
;或某些变体),我尚未授予自己访问权限的任何配置文件都会明确给出错误Access to the path 'C:\\Users\\%SomeUsername%' is denied.
; ; even with the Force switch included.即使包括强制开关。
Is there a way to "click continue" via PowerShell;有没有办法通过PowerShell“点击继续”; ie have the system give me access to anything which I don't strictly have access to, though as an administrator on the server can grant myself access to.即让系统允许我访问我没有严格访问的任何内容,尽管作为服务器上的管理员可以授予自己访问权限。 Ideally this would be done as I access the files (eg by a switch on the Get-Item
command) rather than having to code something to explicitly go through all files checking and amending permissions.理想情况下,这将在我访问文件时完成(例如,通过Get-Item
命令上的开关),而不必编写代码来明确检查所有文件并修改权限。
My mistake;我的错; I hadn't been running the PowerShell session as administrator (ie UAC).我没有以管理员身份(即 UAC)运行 PowerShell 会话。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.