A long subject I know - wasn't quite sure how to sum it up.
I'm new to the board and to KiX in general so a big "hi" goes out to all of you, have been browsing the forums and picking bits of code up here 'n' there.

I'm writing (or trying to write) a KiX script that does the following :
1) Takes the import.csv file (which is a special-format CSV)
2) Runs through it, carving the CSV into sections
3) Adds the domain OU (if it doesn't exist)
4) Adds the user to the domain UNLESS a duplicate user exists already, in that case, it should add a number to the end of the username (starting at '2' depending on how many duplicates).
5) It then sets passwords, group memberships and special attribs (such as change password @ next logon etc.)
6) Upon all of that being a success, it then creates the user home directory, assigns relevant permissions.
7) Displays a small 2-line status page giving the username
that was created, the password they were given and the path to their home directory.

Now, I've managed to do 1,2 and 3 by myself. But the duplicate checking I have is crude - all it does is see if a user with the same USERNAME exists, it doesn't add any numbers on or anything - but I'm sure I can figure that myself using the KiX manual and it's examples.

My problem is with the later steps - particularly 5 and 6.
The creating of username and associated password is fine (as I'm CURRENTLY shelling out using DSADD) so it does the entirity of '5' for me - but I'd rather use a pure KiX solution if possible (as in, it shells out to things ONLY when it must). I know you can add a user with KiX, but it's doing all that DSADD does that concerns me, particularly the 'user must change password at next login'.
If it can only part be done with KiX, then I'll stick with using DSADD.

While I am capable of creating a directory with KiX, it's the setting of permissions I'm unsure how to do. I'd rather not have to shell out to CACLS if I can avoid it.

One last thing - is it simple to script in KiX something that adds a domain user to a group (just 1 group) ? I'll look through the manual myself later and see but I'm unsure.