Another cool case that show us how Microsoft Windows editions works with SMB protocol.
Let's think about the whole scenario:
- When try redirect printing to any LPT port results in ‘Access Denied’ .
- Using the command “net use lpt1 \\computername\printername” to redirect the output from an legacy application to a network printer. This command was working fine under Windows 2003 in order to enable network printing from the DOS application. After migrating the Print Server for Windows 2008 based the CMD (DIR >LPT1) and DOS Legacy Application it's not working.
- Message "Access Denied" and "Printer not Available".
- Download Processor Monitor and executed on Print Server.
- Analyze the Logs and found the following information:
Date & Time: 23/11/2011 15:12:23
Event Class: File System
Result: ACCESS DENIED
Desired Access: Generic Write, Read Attributes
Options: Synchronous IO Non-Alert, Non-Directory File
- To resolve the issue we need to change the way the Servers and Workstations communication with each other.
- Since the Windows Vista, Microsoft upgrade this way to communication using the SMB version 2.
Server Message Blocks Protocol (SMB) is the file sharing protocol used by default on Windows-based computers. SMB 1.0 was designed for early Windows operating systems , but until Windows Server 2008 and Vista.
SMB 2.0 was introduced in Windows Vista and Windows Server 2008. SMB 2.0 is designed for the needs of the next generation of file servers. Windows Server 2008 R2 and Windows Vista and Windows7 support both SMB 1.0 and SMB 2.0 in order to preserve backward compatibility.
Here's how SMB is used when related to SMB versions:
○ When a Windows Server 2008/Vista "client" connects to a Windows Server 2008/Vista "server", SMB 2.0 is used.
○ When a Windows Server 2008/Vista "client" connects to a Windows 2000/XP/2003 "server", SMB 1.0 is used. ○ When a Windows 2000/XP/2003 "client" connects to a Windows Server 2008/Vista "server", SMB 1.0 is used.
○ When a Windows 2000/XP/2003 "client" connects to a Windows 2000/XP/2003 "server", SMB 1.0 is used.
- OK. Now the solution:
- Using the Regedit to disable SMB2 on the server (I used this one).
1.Run "regedit" on Windows Server 2008 based computer.
2.Expand and locate the sub tree as follows.
3.Add a new REG_DWORD key with the name of "Smb2" (without quotation mark)
Value name: Smb2
Value type: REG_DWORD
0 = disabled
1 = enabled
4.Set the value to 0 to disable SMB 2.0, or set it to 1 to re-enable SMB 2.0.
5.Reboot the server.
- Restarted Services ["Server" "Printer Spooler" "Workstation"] . I prefer restart the server (but sometimes customer cannot).
- Get a new ProcMon and no access denied or \\;LanmanRedirector logs found.
- Tested DIR >LPT1 = OK
- Tested on application and works.