Use smbpasswd command. If SAMBA server is configured properly with LDAP, smbpasswd should able to change or set a password for user.
Add user foo
Add workstation w100
Code:
smbpasswd -m -a w100$
If you want sync password then you make sure smb.conf has following entry:
Code:
ldap passwd sync = on
or
Code:
ldap passwd sync = only
This option is used to define whether or not Samba should sync the LDAP password with the NT and LM hashes for normal accounts (NOT for workstation, server or domain trust

on a password change via SAMBA. See url
http://www.unav.es/cti/ldap-smb/smb-ldap-3-howto.html