Windows

如何在訪問共享時強制 Windows 提示輸入憑據

  • February 1, 2020

預設情況下,當我訪問某些電腦的共享時(在 Windows Explorer 中鍵入 \hostname),Windows 會傳遞我目前使用者的憑據。僅噹噹前使用者的憑據不正確時才提示輸入憑據。

有什麼方法可以強制 Windows 不傳遞目前使用者的憑據,而是提示它們?我考慮過使用net view命令,但它沒有獲取“使用者”和“密碼”參數。

如果你輸入命令

net use \\SERVERNAME /u:DOMAIN\USER 

訪問該伺服器時,系統將提示您輸入該使用者的密碼

如果接受的答案給你這個錯誤;

System error 1219 has occurred.

Multiple connections to a server or shared resource by the same user, using 
more than one user name, are not allowed. Disconnect all previous connections 
to the server or shared resource and try again.

您需要先刪除現有共享。如果您趕時間,這將摧毀所有這些,無論伺服器如何;

NET USE * /DELETE

如果您想更精確一點並保留其他共享,請使用以下命令列出伺服器上的現有共享;

NET VIEW \\SERVERNAME

然後刪除與之衝突的共享;

NET USE \\SERVERNAME\SHARENAME /DELETE

最後,使用接受的答案會成功;

NET USE \\SERVERNAME\SHARENAME /u:USERNAME
Enter the password for 'USERNAME' to connect to 'SERVERNAME':
The command completed successfully.

引用自:https://serverfault.com/questions/268938