Microsoft basically recommends to disable printing
Cybercriminals are actively exploiting the vulnerability and enterprises are at great risk. Microsoft is working on a patch, until it's ready the software giant recommends disabling the Windows Print Spooler service or restricting inbound remote printing through Group Policy settings. Neither option is ideal for businesses. The first option makes it impossible to print locally and remotely, and the second option means it will no longer be possible to remotely print documents.BleepingComputer has more info about mitigating the bug over here:
The available options include disabling the Print Spooler service to remove printing capability locally and remotely, or disabling inbound remote printing through Group Policy to remove remote attack vector by blocking inbound remote printing operations.
In the second case, Microsoft says that "the system will no longer function as a print server, but local printing to a directly attached device will still be possible."