Question

The story behind this question is that I have an application running on many client computers.

It is required that end users running the application close the application when they are notified about new online updates. All clients are using the same SQL server database.

When the server application needs to be updated, which also has SQL Server installed a update is required for all computers on the network. I have started sending a message to all users like MsgBox("You have to shut down our software on all other computers").

I would like to ask the server operator does he want to close our application on all other computers.

I've succeed doing this using the command prompt and sending messages via users on the network. However, in this case I knew what the Username and Password of the computer.

I want to be able to access remote computers running my application in order to turn of my application (or any other process).

I want to know if it is possible using VB.net or something else where I can log onto the server and obtain all usernames and passwords of the computers connected to my server computer?

If this is not possible then I would like to know of a method using the command prompt to send a message to all computers on the network running my application. This would be used to notify end users that the application needs to be shutdown. Something similar to MSG NET.

I've tried various ways I found on the internet but I had no success in this.

If you need more information or you want me to make my request more clear just let me know.

Était-ce utile?

La solution

If you do not know the usernames then you can send a message to all computers connected to the server using the msg * /SERVER:servername "message" command.

You can also use the /v switch to see the specific tasks that the msg command is performing.

Note: The msg command is intended to be used as a messaging system to terminal server users, not necessarily between two Windows 7 computers, for example.

This will send a message to all users that have a session on the server.

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.`

You can also use Net session or net sess to run net session. Use net session to view the computer names and user names of users on a server, to see if users have files open, and to see how long each user's session has been idle.

Remarks: You can also use net sessions or net sess to run net session. Use net session to view the computer names and user names of users on a server, to see if users have files open, and to see how long each user's session has been idle.

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

To display one user's session, use ComputerName with the command. The information about a single user includes a list of shared resources to which the user has connections. A session is recorded when a user at a client successfully contacts a server. A successful session occurs when the two computers are on the same network, and the user has a user name and password that are accepted by the server.

A user at a client has to have a session with a server before he or she can use the resources of the server, and a session is not established until a user at a client connects to a resource. A client and a server have only one session, but they can have many entry points, or connections, to resources.

To set how long a session can remain idle before being automatically disconnected, set the autodisconnect feature by using net config server /autodisconnect. For more information about net config server, see Related Topics. An automatic disconnection is transparent to the user because the session is automatically reconnected when the user accesses the resource again. To end a session with the server, use net session \ComputerName /delete.

Autres conseils

You Can use MSG.exe on your computer, follow this Link Send Message over network using CMD

Edit

If you get "Access Denied" or "Error 5 getting session names" do as follow:

  1. open Registry Editor ( regedit.exe ).

  2. In the left panel, locate and then click on the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server

  3. In the right panel, find the key AllowRemoteRPC and be sure the value of the key is 1. If the value is not 1, change it to 1.

  4. Close Registry Editor and restart your computer.

Hope this help.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top