<< Back to Script Library

List User’s Mapped Network Drives

When run against a user session, it will report the drive letter and UNC path of the user's mapped drives.
Version: 1.2.4
Created: 2015-07-13
Modified: 2015-07-13
Creator: josh_edwin
Downloads: 1406
Tags: file system Mapped Drives
The Script Copy Script Copied to clipboard
$drives = Get-WmiObject -Class Win32_MappedLogicalDisk | select @{Name="Drive";Expression={$_.Name}}, @{Name="UNC Share";Expression={$_.ProviderName}}

if ($drives -ne $null) {Write-Output $drives | ft -AutoSize}
if ($drives -eq $null) {Write-Output "No mapped drives present in this user's session."}