Unattended user account creation and immediate configuration

R

Rainer Menzner

Hi,

within a setup tool of a software package, I have been trying for a few days
to implement creating new user accounts (using NetUserAdd()) and configuring
these newly created account (e.g., restrict their access rights via the registry)
under WinNT and WinXP.

While the creation of user accounts works, it is impossible to edit the new accounts,
because for some reason, the profiles / registry hives for these new accounts do not
yet exist.

As far as I can guess from the docu I've read so far, this profile
information is generated when that user logs in the very first time. So I tried
adding the TCB_NAME privileg to the setup account and logged in the newly created
users using LogonUser() with the INTERACTIVE flag set, but no success. I can't seem
to enforce the creation of a user hive / profile data which then can be edited.

Hence my question:

Is there actually no way to batch-create a user profile / hive? Is it actually required
for each new account, that the respective user logs in interactively before the account
can be configured?

Thanks for your help,

-Rainer
 
K

Kent W. England [MVP]

AFAIK, you can only configure an existing profile or you create a script
that runs when that user logs on for the first time. Use a setup tool of
a software package to do this. ;-)

--
Kent W. England, Microsoft MVP for Windows



Rainer Menzner said:
Hi,

within a setup tool of a software package, I have been trying for a few days
to implement creating new user accounts (using NetUserAdd()) and configuring
these newly created account (e.g., restrict their access rights via the registry)
under WinNT and WinXP.

While the creation of user accounts works, it is impossible to edit the new accounts,
because for some reason, the profiles / registry hives for these new accounts do not
yet exist.

As far as I can guess from the docu I've read so far, this profile
information is generated when that user logs in the very first time. So I tried
adding the TCB_NAME privileg to the setup account and logged in the newly created
users using LogonUser() with the INTERACTIVE flag set, but no success. I can't seem
to enforce the creation of a user hive / profile data which then can be edited.

Hence my question:

Is there actually no way to batch-create a user profile / hive? Is it actually required
for each new account, that the respective user logs in
interactively before the account
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top