Friday 15 May 2015

Creating an alias of an SMB server in Windows Server 2012

During the process of a file server migration I wanted to temporarily create an alias for a file server I was decommisioning - although after adding a DNS entry in AD and pointing to the old DNS server I was unable to access its UNC path via Windows Explorer (the error message simply stated the network recourse was not found) - so I decided to mount it via the 'net' command and got a little for information:
net use \\serveralias
You were not connected because a duplicate name exists on the network. If joining a domain, go to System in Control Panel to change the computer name and try again. If joining a workgroup, choose another workgroup name.

This error is occuring because the server you are attempting to access is addressable by two different names - in my case "fileserver01" and "tempserver01." By default Windows Servers / the SMB implementation checks the host header / hostname of the the connecting (client) SMB session - if it is not that of the servers hostname it will simply decline the connection.

Now in order to get around this we can disable strict name checking on the lanman service from the servers registry. In order to do this we should open regedit and go to the following location:
HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > lanmanserver > Parameters
Create a new 32bit DWORD named DisableStrictNameChecking and set its value to 1 (Decimal).

We should now restart the lanman server as follows within an elevated command prompt:
sc stop LanmanServer && sc start LanmanServer
You should now be able to connect to the alias - although I would verify using the 'net' command firstly.

Additionaly the users on the specific network accessed the file server by it's NETBIOS name, rather than its FQDN - so in order to ensure users could still access the file server I utlilized single label DNS entries.


Post a Comment