In order to automatise check of printers, I would like to call rpc commands such as enumprinter or enumdriver.

How to make it without connecting to the SMB domain but directly as root?

With rpcclient Domain credential must be provided. With smbclient I can only get the list of shared printers.


Depending on the setup of the machines in question, you may be able to use rpcclient as the anonymous user:

rpcclient -U "" -N -c enumprinters YOURMACHINE

Note that this may not work for Windows machines with the default group policy, but should work for most Samba setups.

  • Works on all my machine except one (which is identical to the others) : I got Could not initialise lsa pipe. Error was NT_STATUS_ACCESS_DENIED Could not obtain sid for MY_DOMAIN etc etc Do you know what to do to in this case? – MUY Belgium Apr 15 '16 at 6:49
  • Not yet. That's the same problem you get when trying to connect to Windows machines as the anonymous user, so if you can work out how to solve it you might have come up with a more general solution. – Zanchey Apr 17 '16 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.