How to connect to a remote server using "net use" with different port other than 445

If you have control of the remote server and it is a windows server, then try running the following from an elevated (run as administrator) command prompt on the remote server:

netsh a s a state off

Do not leave it in this state as it will turn off the firewall completely to allow you to test. Then try your net use command again on the client. If this works, then it is a firewall problem. Turn the firewall back on:

netsh a s a state on

Then resolve the firewall issue by adding an appropriate rule (for TCP 445), or change the profile of the network.

Other answers suggest TCP port 139, but for SMB this is only needed if you will access the machine by its NETBIOS name. It is used for name resolution even when SMB protocol is used. In fact, in that case you made need TCP ports 137-139 open. The actual share access is done via TCP port 445 (since Windows 2000!) and if you will only access the machine via IP then that is the only port that will be used.

However, temporarily turning off the firewall as I suggest will tell you if it is a port/firewall issue.


It may have something to do with SID compression on Windows 2012 servers in connection with older NASes - but if thats what hurts you depends on your particular configuration. I stumbled upon it after specific update was installed on DCs (2012R2), after which I couldn't access SMB shares on older Thecus NAS. There was no kerberos authentication (checked with klist command). Here is the solution: https://support.microsoft.com/en-us/help/2774190/resource-sid-compression-in-windows-server-2012-may-cause-authorization-problems-on-devices-that-do-not-support-resource-sid-compression