加入收藏 | 设为首页 | 会员中心 | 我要投稿 东莞站长网 (https://www.0769zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

windows-server-2008-r2 – 永久挂载网络共享而无需登录? (视窗

发布时间:2021-03-14 22:45:10 所属栏目:Windows 来源:网络整理
导读:在 Windows 2008 R2服务器(标准版)上,我需要安装网络驱动器,而无需特定用户首先登录到计算机.在Unix机器上通过fstab类似于NFS挂载.网络驱动器将通过BlackArmor(Seagate)设备(我假设运行Samba)共享.如果需要,设备可以是域的成员. 到目前为止,我已尝试使用编辑

在 Windows 2008 R2服务器(标准版)上,我需要安装网络驱动器,而无需特定用户首先登录到计算机.在Unix机器上通过fstab类似于NFS挂载.网络驱动器将通过BlackArmor(Seagate)设备(我假设运行Samba)共享.如果需要,设备可以是域的成员.

到目前为止,我已尝试使用编辑组策略 – >配置 – > Windows – >脚本 – >启动,我执行它

net use x: servershare /user:username password

没有成功.登录后,网络驱动器在Windows资源管理器中被视为断开连接的网络驱动器.

根据 this StackOverflow post,这显然是可能的.

然而,在发布答案内容之前,我是否可以建议您过度复杂?

在这样的情况下,一些蹩脚的代码片段需要用户登录才能运行(如Domino服务器,抱怨)我创建了一个服务帐户,该帐户始终在给定服务器上登录,并设置自动登录脚本,这样机器会在重启时自动登录指定的帐户.我建议对您的问题更简单,更可支持的解决方案是做同样的事情,并通过组策略或登录脚本为该服务帐户用户映射驱动器.

无论如何,如果您决定在没有用户背景的情况下尝试此操作,请参阅下文.这是一个黑客,所以使用风险和所有:

For this hack you will need SysinternalsSuite by Mark Russinovich: 07001

Step one: Open an elevated cmd.exe prompt (Run as administrator)

Step two: Elevate again to root using PSExec.exe: Navigate to the folder containing SysinternalsSuite and execute the following command “psexec -i -s cmd.exe” you are now inside of a prompt that is “nt authoritysystem” and you can prove this by typing “whoami”. The -i is needed because drive mappings need to interact with the user

Step Three: Create the persistent mapped drive as the SYSTEM account with the following command “net use z: servernamesharedfolder /persistent:yes”

It’s that easy!

WARNING: You can only remove this mapping the same way you created it,from the SYSTEM account. If you need to remove it,follow steps 1 and 2 but change the command on step 3 to: “net use z: /delete”

NOTE: The newly created mapped drive will now appear for ALL users of this system but they will see it displayed as “Disconnected Network Drive (Z:)”. Do not let the name fool you. It may claim to be disconnected but it will work for everyone. That’s how you can tell this hack is not supported by M$.

来自评论:

To get it working after a reboot,create a script just containing net use z: servernamesharedfolder and set it to run on computer startup,per technet.microsoft.com/en-us/library/cc770556.aspx This will run as the SYSTEM account,so no need for psexec.

(编辑:东莞站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!