确定用于映射网络驱动器的域和用户名

发布于 2024-12-29 12:20:00 字数 1032 浏览 0 评论 0原文

使用带有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

悲喜皆因你 2025-01-05 12:20:00

WMI 是你的朋友:

> wmic netuse where LocalName="Z:" get UserName /value

UserName=rd-pc2037\Administrator

[匿名建议2022-08-07]:

由于 Microsoft 正在逐渐放弃 WMI,
Powershell/CIM 是您未来的朋友:

获取 CimInstance -classname Win32_NetworkConnection |选择对象远程名称,用户名

WMI is your friend:

> wmic netuse where LocalName="Z:" get UserName /value

UserName=rd-pc2037\Administrator

[anonymous suggestion 2022-08-07]:

Since Microsoft is gradually moving away from WMI,
Powershell/CIM is your future friend:

Get-CimInstance -classname Win32_NetworkConnection | select-object Remotename,Username

穿透光 2025-01-05 12:20:00

使用备用凭据时,这些答案都没有帮助。它们仅显示当前的本地用户。那没有帮助。

要查看所有存储的凭据,请使用...

rundll32.exe keymgr.dll, KRShowKeyMgr

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...

rundll32.exe keymgr.dll, KRShowKeyMgr
嘿看小鸭子会跑 2025-01-05 12:20:00

根据 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.

咽泪装欢 2025-01-05 12:20:00

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文