View File Shares, Printer Shares and sessions.

      NET VIEW [\\computername [/CACHE] | [/ALL] | /DOMAIN[:domainname]]

   /ALL            Display all the shares including the $ shares.
   /CACHE          Display the offline client cache settings for resources on the specified computer.
   computername    A computer whose shared resources you want to view. 
   domainname      The domain to view, by default all domains in the LAN.

Net View / ALL allows you to enumerate all the shares on a remote computer, similar to the old ShareUI utility.

The NET VIEW command is dependent on NetBIOS. On most modern networks this will retrieve an incomplete list of nearby computers or none at all when NetBIOS is disabled.

The system error: "System error 1231 has occurred. The network location cannot be reached." often indicates an attempt to use the insecure and deprecated SMB1 protocol, which is disabled in all recent versions of Windows.

List remote shares with PowerShell:

# List the non-admin$ ("Type=0") file shares on the remote server: SERVER64.
$shares = Get-CIMInstance –Classname Win32_Share -computername SERVER64 -filter "Type=0"
$shares | foreach {
"     Share Name   : $name
     Source Folder: $path
     Description  : $Description
     Caption : $Caption"


Display a list of computers in the current domain:


List the File/Printer shares on a remote computer:

NET VIEW \\ComputerName


List the shares on a remote computer including hidden shares:

NET VIEW \\ComputerName /All

List all the shares in the domain:


Display a list of local shares, the Share Name, full path to the resource being shared and any comment/remark:

NET SHARE sharename

Some NET commands will require elevation.

“The belief that one’s own view of reality is the only reality is the most dangerous of all delusions” ~ Paul Watzlawick

Related commands

NET.exe - Manage network resources.
NET USE - connect to a file share (Drive MAP).
Use NET VIEW against an IPv6 address - Raymond Chen.
Enable Admin Shares
OPENFILES - List or disconnect open files, local or remote (requires elevation).
PsFile - Show files opened remotely.
PsLoggedOn - Who’s logged on.
Equivalent bash command (Linux): users - Users currently logged in, who currently logged in.

Copyright © 1999-2024
Some rights reserved