如果您不知道用户名,则可以使用 msg * /SERVER:servername "message" 命令向连接到服务器的所有计算机发送消息。
您还可以使用 /v 开关查看 msg 命令正在执行的具体任务。
注意: msg 命令旨在用作终端服务器用户的消息传递系统,例如,不一定在两台 Windows 7 计算机之间。
这将向在服务器上有会话的所有用户发送一条消息。
MSG {username | sessionname | sessionid | @filename | *}
[/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]
username Identifies the specified username.
sessionname The name of the session.
sessionid The ID of the session.
@filename Identifies a file containing a list of usernames,
sessionnames, and sessionids to send the message to.
* Send message to all sessions on specified server.
/SERVER:servername server to contact (default is current).
/TIME:seconds Time delay to wait for receiver to acknowledge msg.
/V Display information about actions being performed.
/W Wait for response from user, useful with /V.
message Message to send. If none specified, prompts for it
or reads from stdin.`
您也可以使用Net session 或 net sess 来运行 net session。
使用 net session 查看服务器上用户的计算机名和用户名,查看用户是否打开了文件,以及查看每个用户的会话空闲多长时间。
备注:
您还可以使用 net sessions 或 net sess 来运行 net session。
使用 net session 查看服务器上用户的计算机名和用户名,查看用户是否打开了文件,以及查看每个用户的会话空闲多长时间。
The information appears in a format similar to the following:
Computer User name Client type Opens Idle time
------------------------------------------------------------------------
\\BASSETT CHRISDR Windows 2000 1 00:00:13
\\SHARONCA Administrator DOS LM 2.1 0 01:05:13
要显示一个用户的会话,请将 ComputerName 与命令一起使用。关于单个用户的信息包括用户连接的共享资源的列表。
当客户端的用户成功联系服务器时,会记录一次会话。当两台计算机在同一网络上时,会话成功,并且用户具有服务器接受的用户名和密码。
客户端的用户必须与服务器建立会话才能使用服务器的资源,并且在客户端的用户连接到资源之前不会建立会话。客户端和服务器只有一个会话,但它们可以有很多入口点或资源连接。
要设置会话在自动断开之前可以保持空闲多长时间,请使用 net config server /autodisconnect 设置自动断开功能。有关网络配置服务器的更多信息,请参阅相关主题。自动断开连接对用户来说是透明的,因为当用户再次访问资源时会话会自动重新连接。
要结束与服务器的会话,请使用 net session \ComputerName /delete。