

How do I disable mapped drives in group policy? Double-click on Remove “Map Network Drive” and “Disconnect Network Drive” setting.Navigate to File Explorer in the User Configuration.Remove Map Network Drive & Disconnect Network Drive options How do I remove a mapped drive from group policy? For example, we have a drive mapping using the letter Z, so we have to type: net use Z: /delete. Open it and type: net use drive letter /delete. One method that works in all modern versions of Windows is to use the Command Prompt. net use /del Z: Similarly to delete all the mapped drives we can run the below command. For example to disconnect the network share mapped to the drive z: we can run the below command. We can delete mapped drive command line using ‘net use’ command. On the mapped network drive that you want to delete, right-click, and delete. Navigate to the following path – HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2. Open Regedit by searching it on windows search. You can find more topics about PowerShell Active Directory commands and PowerShell basics on ShellGeek home page.How do I remove a mapped drive from a batch file? We have seen different ways like Get-PSDrive, net use, WMI method, and CIM method to list mapped drives and mapped network drives on the local computer and remote systems. I hope you like the above article on how to get mapped network drive using PowerShell. In the above command, it gets mapped network drive on the remote computer specified by the ComputerName parameter.Ĭool Tip: Get Printer IP address, port, and model information using PowerShell! Conclusion To get mapped network drives on a remote computer using the CIM method, use the below command Get-CimInstance -ClassName Win32_MappedLogicalDisk –ComputerName RemoteComputer | Select SystemName, DeviceID, ProviderName Refer to the below command to view mapped drives on the local system PS C:\> Get-CimInstance -ClassName Win32_MappedLogicalDisk | Select SystemName, DeviceID, ProviderNameĬool Tip: How to get the driver’s version using PowerShell! Using the CIM method to get mapped drive on a remote computer In the above command, it gets mapped network drives on the remote computer specified by the ComputerName parameter.Ĭool Tip: How to use a multiline command in PowerShell! Using CIM Method to get mapped network drive Use CIM method to get available mapped drive on local computer Get-WmiObject -ClassName Win32_MappedLogicalDisk –ComputerName corp-in-200| Select PSComputerName, Name,ProviderName Using WMI method, Win32_MappedLogicalDisk class is used to get mapped network drive on the remote computer. PS C:\> Get mapped drive on the remote computer using WMI PowerShell WMI method, Win32_MappedLogicalDisk class is used to get mapped network drive on local computer PS C:\> Get-WmiObject -ClassName Win32_MappedLogicalDisk | Select PSComputerName, Name,ProviderName The above PowerShell script, lists mapped drives on the local system.Ĭool Tip: How to get memory usage in PowerShell! Using WMI to get mapped network drives Use WMI to get available mapped drive on the local computer OK K: \\corp-in-18\Software Microsoft Windows Network Use net use cmd in PowerShell, get all available mapped drives in Windows System PS C:\> net use New connections will be remembered. PS C:\> Get mapped network drives using net use To get a specific network drive with the letter k, use the Where condition to check the name equal to the drive letter as given below PS C:\> Get-PSDrive | Where

Name Used (GB) Free (GB) Provider Root CurrentLocation Using PowerShell Get-PSDrive cmdlet, get all available drives. 5 Conclusion Using Get-PSDrive to get mapped drives
