Running an AD joined Samba server and trying to setup home directories for users per these instructions. https://wiki.samba.org/index.php/Setting_up_a_home_share

I got the error:

# net rpc rights grant "HOME\Domain Admins" SeMachineAccountPrivilege SePrintOperatorPrivilege SeAddUsersPrivilege SeDiskOperatorPrivilege SeRemoteShutdownPrivilege -Uadministrator
Enter administrator's password:
Failed to grant privileges for HOME\Domain Admins (NT_STATUS_ACCESS_DENIED)

Which led to these instructions and a hour of searching for an answer. https://wiki.samba.org/index.php/Setup_and_configure_file_shares_with_Windows_ACLs#SeDiskOperatorPrivilege

The fix is, the instructions on that second link are no longer accurate for the combination of 2012R2 and Samba4.  I found the fix here. https://lists.samba.org/archive/samba/2014-April/180369.html

I think the command line you typed is using a old syntax. This is working for me on a 4.1.6 :

[root at srvfichiers.tranq ~]# net sam rights grant "TRANQUILIT\\domain admins" SeDiskOperatorPrivilege
Granted SeDiskOperatorPrivilege to TRANQUILIT\domain admins

[root at srvfichiers.tranq ~]# net rpc rights list accounts -U Administrator
Enter Administrator's password:
....
TRANQUILIT\domain admins
SeDiskOperatorPrivilege

In short the fix is:

net sam rights grant "HOME\\domain admins" SeDiskOperatorPrivilege -U<DomainAdminUser>

On to the next problem.