The functions in usermgmt.js are aimed to be a bridge between a user-level application (mainly the UI), and Samba internals. The function prototypes are designed by looking at the UI, like for example: New User UI (from MMC/Local Users and Groups) The UI asks for: Username Fullname Description Password and some flags, basically: user must change password at next logon account is disabled user cannot change password password never expires And Samba requires: unixName So, we have the user_add function that does this: function user_add(sam, username, fullname, description, password, flags, unixname) Other functions: user_delete(sam, username) user_rename(sam, username, newname) TODO: add/remove users to groups user enumeration functions