How to prevent GPO from mapping network drives on my PC?

10,008

Solution 1

I am not going to tell you how to subvert the doings of your IT department. However, if they are semi-reasonable you can ask them you exempt you from that particular GPO. If they don't know how, tell them to add your computer to the permission list and set read from allow to deny and your computer won't apply that GPO anymore.

Solution 2

Drives mapped by Group Policy will either be created:

  • At user logon only (e.g. via a VBS script)
    --or--
  • At user logon and during periodic background refresh of GP when using a Group Policy Preference item

Unless your IT department is willing to remove you from their drive mapping policy, you cannot prevent the drives from being mapped. However, you can use a script to delete the mapped drives and have that script run each time you log into your computer.

Sample batch script:

rem Wait for user logon to complete and drives to be mapped...
TIMEOUT /T 30 /NOBREAK

rem Disconnect mapped drives...
NET USE K: /delete
NET USE P: /delete
<repeat for other drive letters>

Save this script as UnmapDrives.cmd in your Startup folder which in Windows 7/8 is located at: %AppData%\Microsoft\Windows\Start Menu\Programs\Startup.

If your IT department is using GP Preferences to map the drives, they may re-appear once or twice during a normal workday. In that case you could either manually run the above script, or schedule it to run every so often as a Scheduled Task.

Solution 3

If they are mapping the drives with GPO Preferences, they can add a ping test to see if the server is available before mapping the drive. In the drive mapping preference item, add item-level targeting, and select the WMI query targeting option. The WMI query would be something like

SELECT StatusCode FROM Win32_PingStatus WHERE Address="ServerNameHere" and StatusCode=0

If this ping is successful, the drive maps. In disconnected situations, the ping fails and the drive does not map.

Of course, they can do a similar thing if they are mapping the drive via a script.

Share:
10,008

Related videos on Youtube

Joe
Author by

Joe

Updated on September 18, 2022

Comments

  • Joe
    Joe over 1 year

    I'm using a Windows 8.1 laptop I got from my workplace and it's a member of the workplace domain. The IT department at my workplace thinks it's a good idea to enforce mapped network drives for all computers in the domain through GPO. I don't understand why, since the same benefits can be obtained by using shortcuts.

    The problem with mapped drives is that when I'm not on the workplace internal network (for example when I'm working from home) every action that has to do with files becomes very slow, whether it involves the mapped drives or not. For example, opening a Save dialog, opening "My Computer", etc. When I disconnect the mapped drives the slowness disappears.

    After Googling I found that the reason for the slowness is that Windows keeps trying to contact the mapped drives.

    The mapped drives keep getting reconnected due to the GPO after every restart, and sometimes even without a restart. I haven't figured out what triggers the reconnection exactly.

    I have no use for the mapped drives (I have shortcuts instead), they are slowing my computer down so much it's unbearable, and when I asked the IT guys to stop using them they looked at me as if I'm crazy.

    How can I permanently disconnect the mapped drives and prevent the GPO from reconnecting them?