Equivalent of net use (to list computer's connections) in powershell? Equivalent of net use (to list computer's connections) in powershell? powershell powershell

Equivalent of net use (to list computer's connections) in powershell?


For the mapped logical drive you can use WMI class Win32_MappedLogicalDisk :

Get-WmiObject Win32_MappedLogicalDisk

Here is another way with Win32_LogicalDisk :

PS C:\> Get-WmiObject -Query "Select * From Win32_LogicalDisk Where DriveType = 4"DeviceID     : V:DriveType    : 4ProviderName : \\jpbdellf1\c$FreeSpace    :Size         :VolumeName   :

Edited

You are right, you can get what you need with Win32_NetworkConnection :

PS > Get-WmiObject Win32_NetworkConnectionLocalName                     RemoteName                    ConnectionState               Status---------                     ----------                    ---------------               ------                              \\jpbasusf1\temp              Connected                     OK

On Seven or W2K8 be careful to call this with the same user that run the NET USE because it's a session information.