Disable SMB1 on Windows
To defend yourself against WannaCrypt and other ransomware it is imperative that you disable SMB1 as well as install the patches released by Microsoft.
Open Control Panel > Programs & Features > Turn Windows features on or off.
In the list of options, one option would be SMB 1.0/CIFS File Sharing Support. Uncheck the checkbox associated with it and press OK.
You can also use powershell
Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB1 -Type DWORD -Value 0 –Force
On Windows servers you can use the Powershell command: Remove-WindowsFeature FS-SMB1