The smb-os-discovery script will help us enumerate the OS version based on the SMB protocol. The syntax for using this script is as follows:
nmap --script smb-os-discovery <Target IP address>
The following screenshot shows the enumeration output telling us that the target system is running a Debian-based OS: