How to see what network drives a remote computer is connected to using powershell
In our Powershell series for performing day to day administrative tasks we want to move on to a task that many admins may need to perform as an information gathering tool in troubleshooting, etc. Â That task is finding what network drives a remote computer is connected to. Â It is so not cool to have to remote into a computer and then open up “Computer” to see which network drives they are connected to. Â Despite being cumbersome and time consuming, it is just not very efficient.
As most admins already know, Powershell is the way of the future with Microsoft scripting. Â So, how can we gather this information by utilizing Powershell? Â Well, by using a Powershell to empower WMI to gather the information, we can quickly and easily get the listing of network drives that the remote computer has mapped.
Get Remote Mapped Drives
Get-WmiObject [-Class] <String> [[-Property] <String[]>] [-Amended [<SwitchParameter>]] [-AsJob
[<SwitchParameter>]] [-Authentication <AuthenticationLevel>] [-Authority <String>] [-ComputerName <String[]>] [-Credential <PSCredential>] [-DirectRead [<SwitchParameter>]] [-EnableAllPrivileges [<SwitchParameter>]] [-Filter
<String>] [-Impersonation <ImpersonationLevel>] [-Locale <String>] [-Namespace <String>] [-ThrottleLimit <Int32>] [<CommonParameters>]
Final Thoughts
The very useful output that the command gives you is the drive letter as well as the servername and sharename that the remote workstation is connected to.