Windows – Group policy to disable auto-disconnect

network-sharewindows

Several drives mapped via GPO keep on disconnecting.
After some googeling I found the feature (more like a bug in my network…) that auto-disconnects active shares after 15 minutes.

I realize that the net config server command solves this issue for a local computer, but I'd like to apply it to the entire network via group policy.

Currently it seems like I'll have to change registry keys manually with this group policy.

Is there a better way?

Best Answer

Your proposal works on the server side: you don't need to run the command on every client computer.

net config server /autodisconnect:-1

Where the number is timeout in minutes from 0 to 65,535 and -1 for disabled.

For client side you can Configure a Registry Item via GPO, namely KeepConn,

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"KeepConn"=dword:0000ffff

Specifies the maximum amount of time that an idle connection can remain open. If the idle time for a connection reaches the value of this entry, the connection is closed. Increase the value of this entry if your application closes and opens Universal Naming Convention (UNC) files on a server less frequently than every 10 minutes. This decreases the number of reconnections to a server.

However, there isn't more direct way to do this via GP.

Some have reported that there's less problems with drives mapped with a net use command during logon scripts than with the ones mapped in GPO, but I wouldn't make any major changed based on that, as using GPO Drive Mappings is way more maintainable.