Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Rename mapped drive with powershell

$
0
0

Hello,

I would like to rename mapped network drives via Powershell.

here is the script i found on the inernet and i have modified it slightly.

param($deviceID = "R:", $name ="NewTest")
$drive = Get-WmiObject "Win32_LogicalDisk WHERE DeviceID = '$DeviceID'"
    if (-not $drive) { return }                      
    $drive.VolumeName = $name
    $null = $drive.Put()
    $Drive.DeviceID



Michael


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>