Install the printer driver locally.
Store HOSTNAME share credentials from the command line:
cmdkey /add:HOSTNAME /user:USER /pass:PASS
Open the control panel (For Windows 11: Windows Settings > Bluetooth & Devices > Devices > More devices and printer settings (at the bottom))
Click Add a printer
Click "The printer that I want isn't listed"
Select "Add a local printer or network printer with manual settings"
Click Next
Select "Create a new port"
Leave "Local Port" selected
Click Next
Enter the share as port name: \\HOSTNAME\SHARENAME
Click Next
Select the printer driver you installed.