Como obtenho uma lista de diretórios compartilhados (e com quem eles são compartilhados)?
net session
fornecerá as informações que você está procurando.
Sessão de Rede
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.
Fonte Sessão de rede
Desconectar um usuário ou usuários
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
...
Sintaxe:
net session \<computer> /delete
onde:
Net session
Lists or disconnects users connected to shared folders on the computer.\<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.
Fonte Desconectar um usuário
Leitura Adicional
- Um índice A-Z da linha de comando do Windows CMD - Uma excelente referência para todas as coisas relacionadas à linha do Windows cmd.
- net - O comando NET é usado para gerenciar recursos de rede.