DFS, NetBIOS, DNS, and clearing all file sharing caches

Just ran up against a nasty DFS/share problem where a FQDN was being redirected to a NetBIOS name. Someday you will thank me for these commands (especially the part where you can make explorer forget share passwords with KeyManager)

By default DFS using NetBIOS referrals. This was a problem switching between on-site, ipsec tunneled sites, and pptp road warriors. You want to disable NetBIOS on all connections and focus on DNS. Here's some helpful stuff.

Then on clients that have problems do
  1. net use * /delete
  2. nbtstat -R
  3. ipconfig /flushdns
  4. rundll32.exe keymgr.dll, KRShowKeyMgr

The above
  1. Disconnects existing connections to shares
  2. Flushes the netbios name cache
  3. Flushes the dns cache
  4. Opens the password manager for you to delete remembered passwords.
Force DFS to use DNS instead of NetBIOS is a gem