I am working at a customer site commissioning a bunch of Windows 7 systems that were just delivered. The systems were imaged with a basic setup that included all of the main software needed for the customer except for a local (non admin) account that is required for this application.
I know that I can run the net user
command to programmatically add the desired local account. However this command does not fully set up the local account. You still need to log into it (and see the your desktop is being prepared message) before the complete windows configuration has been performed for that account. But I don't want to do that - I just want to run my powershell script and say "Done!"
So after running net user
is there anyway via command line or powershell action to trigger the process that fully fleshes out the account?
Edit
My end goal is to have access to the Startup folder for the account I am creating so that I can copy in some shortcuts. And to do all of this via a powershell script with NO user interaction.
Edit 2
And while I need the solution to work under powershell 2, I am also interested in seeing any solution that works under any later powershell version
Tested in Wondows 7 Professional.
First to say, you will see the Your Desktop is beeing prepared message on first logon.
BUT: your goal, adding shortcuts to Startup, is achivable and working.
create a file with following content and save it to desired destination as *.reg file:
This enables interactive logon for accounts with blank passwords (referrence1) (referrence2)
start an elevated cmd prompt
import the regkey
Create your user account
run
runas
as your created user. I started ping and redirected its output to NUL to wait for the profile to be generated.Make Startup directory for your user
Create a shortcut in Startup folder, e.g. via powershell script (example)
Done. As I mentioned, when first logging in you'll see Your Desktop is beeing prepared but the the startup is working correctly.