Monday 24 December 2018

Is there a command in which we can see list of shared directories and with whom they are shared for windows 7?


Is there a command in which we can see list of shared directories and with whom they are shared for Windows 7? I have tried the below commands:


net share    
wmic share get caption,name,path

But I can't get the names of the people or entity with whom they are shared.



Answer



How do I get a list of shared directories (and whom they are shared with)?


net session will give you the information you are looking for.




Net session



Manages server computer connections. Used without parameters, net session displays information about all sessions with the local computer.


Syntax


net session [\\ComputerName] [/delete]


Parameters


\\ComputerName : Identifies the computer for which you want to list or disconnect sessions.



...



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.



Source Net session




Disconnect a user or users



For example, to disconnect a user on a computer named user_computer, which is connected to a shared folder that you are managing, type:


net session \\user_computer /delete

...


Syntax:


net session \\ /delete


where:




  • Net session Lists or disconnects users connected to shared folders on the computer.

  • \\ The name of the computer accessing the shared folder.

  • /delete Ends the session, and closes all open files on the computer for the session. If you omit \computer, the command ends the sessions on the local computer.



Source Disconnect a User




Further Reading



No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...