while trying to add a user to samba
i.e smbpasswd -a user
i get the following error

init_ldap_from_sam: User's Primary Group SID (S-1-22-2-2009) is not for
this domain (S-1-5-21-2472404719-3990724825-3229645963), cannot add to
LDAP!
ldapsam_add_sam_account: init_ldap_from_sam failed!
Failed to add entry for user foma.
Failed to modify password entry for user foma

tried adding the sid
via

net groupmap add rid=513|sid="S-1-22-2-2009" unixgroup="foma"
ntgroup="S-1-5-21-2472404719-3990724825-3229645963"

(this does not return an error . it does fail if rid=513 is ommited)

basicly i am stumped att his poin