NT user profile

Are there any functions I could use to create NT workstation user profiles. I would like to write a program that would be able to create the users, passwords, and priveleges so that people can use these usernames to log in to the NT workstation.