如果您不知道用户名,可以使用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 config server的更多信息,请参阅相关主题。自动断开对用户透明,因为当用户再次访问资源时,会话会自动重新连接。
要结束与服务器的会话,请使用net session \ComputerName /delete。