Saturday, March 27, 2010

NET USE command

The NET USE command is used to associate a local drive letter or device name with a shared network drive or device. Most often, the NET USE command is used for network drive mapping.
The NET USE command can be used also to disconnect a computer from a shared resource, or to display information about computer network connections.

1.How do I display a list of network connections on my computer

Go to yoStart menu--> Run, type cmd and hit enter. Then, type NET USE and you will see
a list of connected network devices

2.How do I disconnect from a share using NET USE?

NET USE [driveletter: or share] /DELETE
Eg : net use z: /delete
net use \\share1\softwares /delete

In some case you want to map the share with another user credentials, and in such situations use the netuse / delete command as explained above to terminate the sessions properly

Managing Terminal Services Sessions Remotely

Normally windows has a limitation of maximum 2 user session in terminal service administration mode

Many times you might have faced problem in connecting to Terminal Services because both sessions are used up. I can use another server to check the status of the first one. As long as the logged in user has administrative rights on the non-accessible machine I would run this:

qwinsta /server:10.196.10.2

Where, 10.196.10.2 is the IP address or name of the non-accessible machine.

This will display something like this:

qwinsta /server:10.196.10.2

SESSIONNAME USERNAME ID STATE TYPE DEVICE

console 0 conn wdconn

rdp-tcp 65536 Listen rdpwd

rdp-tcp#470 Steve 1 Active rdpwd

rdp-tcp#471 Rajesh 3 Active rdpwd

Now I know that Steve and Rajesh are the two that are logged in. Since I know that Rajesh has left the office sometimes ago and might have forgotten to log off, I have decided to terminate his session.

To disconnect Rajesh's session I would type this:

rwinsta /server:10.196.10.2 3

Notice the 3 which is the session ID I found from using qwinsta above.

There is another command, “query “which can serve the same purpose , but i prefer using qwinsta (Query Windows Station) and rwinsta (Reset Windows Station) as they are fully compatible with W2K ,WinXP , W2K3 and win2k8