Vista UAC - 映射网络驱动器的问题 [英] Vista UAC - Trouble Mapping Network Drives

查看:35
本文介绍了Vista UAC - 映射网络驱动器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个以编程方式映射网络驱动器的应用程序.在开启 UAC 的 Vista 上,我们会遇到一些奇怪的问题.

We have an application that programmatically maps network drives. On Vista with UAC on, we get some strange issues.

我们的应用程序映射驱动器未提升,所以如果用户浏览资源管理器并双击运行一个exe,它会提示UAC.因此,当他们批准它时,它会提示输入用户名/密码以进行共享...奇怪,因为凭据已保存.

Our application maps the drive non-elevated, so if the user browses explorer and double clicks to run an exe, it prompts for UAC. So when they approve it, it prompts for a username/password for the share... Strange since the credentials are saved.

事实证明,提升的进程无法访问从非提升的进程映射的映射驱动器.

It turns out, an elevated process cannot access a mapped drive that was mapped from a non-elevated process.

要实际查看此问题,请执行以下步骤:

To see this issue in action, do the following steps:

  • 在没有 UAC 的情况下运行 cmd.exe
  • 运行net use w:\yourHostname\yourShare/user:yourUser yourPassword/persistent:yes"
  • 以管理员身份运行 cmd.exe
  • 输入w:",查看错误信息

此时您可以运行简单的net use"并看到提升的 cmd 上的连接不可用,但其他非提升的 cmd 认为它正常.

At this point you can run plain "net use" and see the connection on the elevated cmd is Unavailable but the other non-elevated cmd sees it as OK.

有人知道解决这个问题的方法吗?或者也许是一种将网络驱动器映射到所有用户"的方法?

Does anyone know a workaround to fix this issue? or maybe a way to map a network drive to "All Users"?

推荐答案

查看此链接:注册链接

它们描述了一个注册表项,允许提升的用户访问映射的驱动器,反之亦然.这解决了我的所有问题,正是我想要的.

They describe a registry key that allows elevated users to access mapped drives and vice versa. This solves all my issues and was exactly what I was looking for.

原始链接已失效,但这是从 2009 年 1 月 24 日快照中复制的文本,位于 www.archive.org:

The original link is dead, but here's the text as copied from the Jan 24, 2009 snapshot at www.archive.org:

如果您发现无法通过管理员令牌访问映射驱动器,请尝试以下操作.作为受保护的管理员运行时,您有两个令牌,此密钥将维护两个令牌的连接(无论如何,这是我的理解).它还可以帮助解决登录脚本的问题.

If you are finding that you don't have access to mapped drives from your admin token try the following. When running as a protected admin you have two tokens and this key will maintain the connection for both tokes (that is my understanding anyway). It can also help to clear up issues with Login scripts.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemEnableLinkedConnections =(dword)1

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System EnableLinkedConnections =(dword)1

本文档的'组策略脚本可能因用户帐户控制而失败"部分也有用.

Also of use is the "'Group Policy Scripts can fail due to User Account Control" section of this doc.

http:///technet2.microsoft.com/WindowsVista/en/library/5ae8da2a-878e-48db-a3c1-4be6ac7cf7631033.mspx?mfr=true

我将很快发布更多相关信息.

I will be posting more information on this soon.

这篇关于Vista UAC - 映射网络驱动器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆