The -A (--authentication-file=FILE) option of rpcclient or equivalent for getting credentials from a file should be implemented in the net command
Fixed in samba-4.10.0