Error 1312 from net use when mapping samba share

左心房为你撑大大i 提交于 2020-07-20 08:55:25

问题


I have written a service that monitors if my app is running and starts it if not. In result the app is run as a "system" user - which is the way I want it to be. I have several of those installations working properly. The app should mount a network share that is in this case available on a linux samba server. The problem is that when running the command:

net use X: \\IP\share_name /user:login password

an error is displayed:

System error 1312 has occured.

A specified logon session does not exist. It may already have been terminated.

I have run some checks and it turns out that the X: drive in local system is available, the server is online, the share is available, the credentials are OK, there are no other net use sessions running in this system. Also I have found out a strange behavior: running identical command as a standard user gives proper results and the drive is mounted properly. Do you have any suggestions what might be the problem and how to solve it?

Additionally I am not a domain member, and the system that shows the error is Windows 7 Pro. I have other machines in the same network that do work properly without the error.


回答1:


I have had the same issue some time ago. It helped when I introduced a domain name (even if you are not a domain member) before the login. I your case try this command: net use X: \\IP\share_name /user:whatEver\login password




回答2:


Test this command:

EXEC XP_CMDSHELL 'net use Z: 192.168.3.55backupShare password@123 /User:domainuser'



来源:https://stackoverflow.com/questions/39326387/error-1312-from-net-use-when-mapping-samba-share

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!