This can be used to unpublish a printer in AD: net ads printer remove testprinter -P but that should also unset the PRINTER_ATTRIBUTE_PUBLISHED bit in the registry. Unticking the publish in AD checkbox on a Windows client managing a samba print server is taling care of that correctly.