This is a change in behaviour i.e. if "List in Directory" was ticked but it isn't published really in AD (removed by some other means etc), it will no longer allow you to "Connect" to it. It used to.
But you also cannot untick "List in Director" in the GUI as Samba can't find the printer in AD (funally enough as it isn't published). But maybe it should still allow this to be unticked, even if not in AD? Not sure...
This is possibly related to Bug #11018 - "smbd can't find the GUID for a printer in the registry and fails to publish printers" and the fix for this.
1/ Ensure you have a printer that isn't published in AD, and "List in Directory" is unticked. And ensure you can install drivers for it.
2/ Stop Samba
3/ net registry export HKLM /root/samba.reg
3/ Then edit /root/samba.reg and look for the keys like:
Where Printername is the name of your printer.
For example I have a key.
my printer is called "dell3130cn1".
4/ Under here there is an entry "Attributes". From my case:
The "List in Directory" setting appears to be controlled by bit 14
(counting from least significant)
In practice we have the same value (presumably all other settings
represented by this key are common to all our printers) so it was easy
i.e. I have
List in Directory NOT set - 01100001001000 - 6216(decimal) - 1848 (hex)
List in Directory set - 11100001001000 - 14408 (decimal) - 3848 (hex)
Put in a new value with this bit 14 flipped to 1 (and the rest of the
values as before) and convert back into hex. Then this is your new
value for this attributes key. For my case change to:
6/ Import this edited registry back into Samba.
net registry import /root/samba.reg
7/ Start Samba and see if from a Windows machine this "List in
Directory" is now set.
8/ Trying to install the drivers should now fail (if you cleared out Windows of the driver installs). Windows machine returns "Windows cannot connect to the printer" "Operation failed with error 0x00000002". And the log has an entry "Failed to get GUID for printer"
9/ Also observe that the "List in Directory" tick box cannot be unticked.
Created attachment 12633 [details]
Proposed patch for master
Created attachment 12634 [details]
patch for 4.5
Created attachment 12635 [details]
patch for 4.4
Created attachment 12636 [details]
patch for 3.6
Ping, should we backport this to 4.5, is it enough to have it 4.6?
as far as I can see one of the problems was that the ticking and unticking of the "publish in AD" feature doesn't work. I still observed the same issue recently with an up-to-date windows machine's print manager and an up-to-date 4.11 samba print server. So this issue didn't get fixed with the patches here so far.