On-the-fly creation of Machine Trust Accounts on Samba

Hi!
As I know, until user password is set, user is unable to log in... The same way in Samba - if user account with some password does not exist in Solaris or password is not set, user will not able to use Samba shares... So, according to impossibilty of automation of setting user password with passwd command, how can I implement such functionality on Solaris?.. I know two ways:

  1. Using some tools like Tcl/expect
  2. Manually write some script, which will add default information as well as default user password to /etc/shadow file. This is very rude way and is not preferred

Is there any other way to create machine accounts on-the-fly? Also any comments and advices are appreciated