如何强制Windows访问共享时提示凭据

默认情况下,当我访问某个计算机的共享(在Windows资源pipe理器中键入\\主机名)时,Windows会传递我当前用户的凭据。 它仅在当前用户的凭据不正确时提示input凭据。

有没有办法强制Windows不通过当前用户的credentails,但提示呢? 我想过使用net view命令,但它不抓住“用户”和“密码”参数。

    如果你input命令

     net use \\SERVERNAME /u:DOMAIN\USER 

    系统将提示您input该用户在访问该服务器时使用的密码

    如果接受的答案给你这个错误;

     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.