Is there a way to get mapped network drives labels? I know it's possible to get multiple properties through the
Get-Object Win32_MappedLogicalDisk
But none of them are labels (please do not misunderstand, I do not want Name i.e. K:, I want labels i.e. My Network drive)
You could use the Com Shell.Application object for this:
Output:
Some explanation for the above:
Using the COM object Shell.Application, you can drill down through its properties and methods.
Another way is to go into the registry, but remember that after a mapped network folder is unmapped, the old registry value remains. This is why below code still uses one of two methods to find active network mappings first:
Output here also: