CUPS as printer client for Microsoft server

Installation
Many Microsoft servers started using encryption for their shares. This is also the case for Windows printer shares. In order to print from your Gentoo installation you need to install samba and cups. However, before doing so, we need to set up some use flags.

Edit /etc/portage/package.use to enable active directory support for cifs and samba. These use flags will pull in the required encryption needed for newer Windows servers. net-fs/cifs-utils		ads creds upcall net-fs/samba			caps addns ads

Next (re)install samba and cups emerge -vuND samba cups

Setting up your printers, is farely simple through the web-interface of CUPS. Point your browser to https://localhost:631 and click Administration and choose Add Printer. You will be asked for a username and password of a printer administrator). Now choose "Windows Printer via SAMBA" and click continue. The connection to the samba share is crucial to get your printers working. If you are on a domain, you will need to enter a connection URL as smb://USERNAME:PASSWORD@DOMAIN/URL/PRINTERSHARE

where you replace USERNAME, PASSWORD, DOMAIN, URL and PRINTERSHARE with the correct values. If not on a network with a domain-server you can leave out the part "DOMAIN/".

Troubleshooting
If you for some reason cannot print you can try to connect to the print server using the samba client. smbclient -W DOMAIN -U USERNAME //SERVER/PRINTER Password: PASSWORD Domain=[DOMAIN] OS=[Windows Server 2008 R2 Datacenter 7601 Service Pack 1] Server=[Windows Server 2008 R2 Datacenter 6.1] smb: \> print test.ps printing file test.ps as test.ps (196,6 kb/s) (average 196,6 kb/s) smb: \> quit

where test.ps is a postscript file located on your own computer in the current working directory.