It should try to run it with knowledge of the system paths. I've installed smbtaquery to /usr/local/bin and it then doesn't work.
Works for me in /usr/local/bin