Encontrei algo semelhante à sua pergunta neste blog: Determine quais unidades são mapeadas para os compartilhamentos de rede , elas forneceram um script e, de alguma forma, você pode editá-lo de acordo com suas necessidades. Faça uma boa leitura.
And so it’s Win32_LogicalDisk to the rescue. With this class not only
can we determine which drives are mapped to network shares, but we can
also determine which network shares they map to. And to do that
requires nothing more than a script like this:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\” & strComputer & “\root\cimv2”)
Set colDrives = objWMIService.ExecQuery _
(“Select * From Win32_LogicalDisk Where DriveType = 4”)
For Each objDrive in colDrives
Wscript.Echo “Drive letter: ” & objDrive.DeviceID
Wscript.Echo “Network path: ” & objDrive.ProviderName
Next
The script starts out by connecting to the WMI service on the local
computer. (As usual, you can modify this script to run against a
remote computer simply by assigning the name of that machine to the
variable strComputer.) We then use this line of code to return a
collection of all the mapped network drives:
Set colDrives = objWMIService.ExecQuery _
(“Select * From Win32_LogicalDisk Where DriveType = 4”)
The key here – as you might have guessed – lies in our Where clause.
We’re asking for all instances of the class where the DriveType is
equal to 4; needless to say, a DriveType equal to 4 represents a
mapped network drive. (For other DriveType values, see the WMI SDK on
MSDN.) The query returns a collection of all the mapped drives; we
then set up a For Each loop to walk through that collection. For each
mapped drive we echo the value of two properties: DeviceID, which
returns the drive letter for the drive; and ProviderName, which
returns the network share the drive is mapped to.
In other words, we get back information similar to this:
Drive letter: E:
Network path: \atl-fs-01\public
Drive letter: F:
Network path: \atl-fs-01\finance
Drive letter: G:
Network path: \atl-fs-01\users\kenmyer