确定用于映射网络驱动器的域和用户名
使用带有 SP1 的 Windows 7 Enterprise,但我希望得到适用于 Windows XP/2003/2008/Vista/7 的通用答案。
在命令提示符下,我执行 net use
命令将 Z: 驱动器映射到另一台计算机上的共享,但我不使用当前的凭据,而是指定了不同的域和用户来映射驱动器。
net use z: \\rd-pc2037\C_DRIVE password /user:rd-pc2037\Administrator
命令成功完成。既然驱动器已映射,我如何找到成功映射驱动器所使用的域和用户名?我似乎无法使用 net use
命令找到我想要的东西。
C:\Users\rdomarat>net use New connections will not be remembered. Status Local Remote Network ---------------------------------------------------------------------------- OK Z: \\rd-pc2037\C_DRIVE Microsoft Windows Network The command completed successfully. C:\Users\rdomarat>net use Z: Local name Z: Remote name \\rd-pc2037\C_DRIVE Resource type Disk Status OK # Opens 0 # Connections 1 The command completed successfully.
在 Windows 资源管理器中检查共享的属性并查看安全选项卡,我看到了不同的人将拥有哪些权限,但我没有看到我使用了哪个 DOMAIN\User
。我在注册表中进行了搜索,但也取得了有限的成功。
有什么想法吗?
Using Windows 7 Enterprise with SP1, but I'm hoping to get a generic answer that would apply to Windows XP/2003/2008/Vista/7.
From a command prompt, I execute a net use
command to map the Z: drive to a share on another computer, but I don't use my current credentials, I specify a different domain and user to map the drive.
net use z: \\rd-pc2037\C_DRIVE password /user:rd-pc2037\Administrator
The command completes successfully. Now that the drive is mapped, how can I find what Domain and Username I used to successfully map the drive? I can't seem to find what I want with the net use
command.
C:\Users\rdomarat>net use New connections will not be remembered. Status Local Remote Network ---------------------------------------------------------------------------- OK Z: \\rd-pc2037\C_DRIVE Microsoft Windows Network The command completed successfully. C:\Users\rdomarat>net use Z: Local name Z: Remote name \\rd-pc2037\C_DRIVE Resource type Disk Status OK # Opens 0 # Connections 1 The command completed successfully.
Checking the properties of the share in Windows Explorer and looking at the security tab showed me what permissions different people would have, but I didn't see how which DOMAIN\User
I had used. I searched through the registry with limited success as well.
Any thought?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
WMI 是你的朋友:
> wmic netuse where LocalName="Z:" get UserName /value
[匿名建议2022-08-07]:
WMI is your friend:
> wmic netuse where LocalName="Z:" get UserName /value
[anonymous suggestion 2022-08-07]:
使用备用凭据时,这些答案都没有帮助。它们仅显示当前的本地用户。那没有帮助。
要查看所有存储的凭据,请使用...
None of these answers help when using alternate credentials. They only show the current, local user. That doesn't help.
To view all stored credentials, use...
根据 http://technet.microsoft.com/en-us/library/cc957215 .aspx
您想要的信息在注册表中。
我已经尝试过 wmic-command,但它显示了本地登录的用户,而不是“使用的 DOMAIN\login”
上面链接中的关键信息:
注册表项
HKCU\Network\{Drive letter}\UserName 是一个 REG_SZ,它指定映射网络驱动器时使用的用户名(包括域名)的凭据。
According to http://technet.microsoft.com/en-us/library/cc957215.aspx
the information you want is in the registry.
I have tried the wmic-command but it showed me the locally logged in user and not the "used DOMAIN\login"
The critical info from the link above:
Registry entry
HKCU\Network\{Drive letter}\UserName
is a REG_SZ that specifies the username (including domain name) whose credentials were used when the network drive was mapped.Windows 11 - 其中一些很有用,但是 Windows 仍然告诉我它已连接到 Windows 资源管理器中未列出的驱动器,但该驱动器未在计算机、管理或网络使用或上述任何选项中列出。因此 Windows 将连接信息存储在其他地方。
确实应该有一种方法可以通过用户名或服务器名全局删除或替换持久连接。
Windows 11 -- some of this is useful, however Windows is still telling me that it has connected to a drive not listed in Windows Explorer, but which is not listed in computer, manage or net use or any of the options above. So Windows is storing connection information somewhere else.
There really should be a way to remove or replace persistent connections globally by username or servername.