Command Line and/or Script to Create Default User profile?

S

Shenan Stanley

I would like to be able to create a default user profile as part of my
unattended installs. Is this possible - automagically?

Essentially, I have several different unattended installations that change
fairly often (updates, etc) and I would like to automate another part of
it - the creation of a Default User profile at the end...

I can make them manually all day - and I suppose I could write a script
using "AutoIt" or something similar to create it that way - but I thought I
would chance that there was some script.application/helpful individual out
there with a better method to create a default user profile automagically..
=)
 
P

Patrick J. LoPresti

Could you clarify what you mean? A Default User profile already gets
created automatically. (At least, I have never seen a system without
one.) What are you trying to automate, precisely?

- Pat
 
S

Shenan Stanley

Shenan said:
I would like to be able to create a default user profile as part of
my unattended installs. Is this possible - automagically?

Essentially, I have several different unattended installations that
change fairly often (updates, etc) and I would like to automate
another part of it - the creation of a Default User profile at the
end...

I can make them manually all day - and I suppose I could write a
script using "AutoIt" or something similar to create it that way -
but I thought I would chance that there was some
script.application/helpful individual out there with a better method
to create a default user profile automagically.. =)
Could you clarify what you mean? A Default User profile already gets
created automatically. (At least, I have never seen a system without
one.) What are you trying to automate, precisely?

Hey Patrick,

Let me start with plugging where your fine work is located:
http://unattended.sourceforge.net/
(For those who don't use an unattended method to install their systems
- why? Do you like the torture? heh)

Yes, I know this, but it is not the default profile with all the changes I
want made to it. I setup a user with all the options and such that I
want them to have. Certain of these settings are on a per-user basis
and the only way to make sure that a new user to this system has
these settings from the start is to create a default user profile.

(Yes - some of these settings would not be affected by any registry
settings other than those located inside the NTUSER.DAT and/or the
changes in the directories under the user profile itself. I have set
them in the .default user registry, current user registry and local
machine registry without success in some cases and other I am not
sure I would want to try to set that way because of their complicated
situation - involving layouts and such.)

So - I create a default user profile for the machine to make sure that
every user that logs into this machine has these particular settings.
Of course this is easily accomplished through these steps:

- Setup my current user in the way I want all my users to look/feel.
- Log out and log in as another user (administrative).
- Open the System Properties window.
- Go to the "Advanced" tab, click on the "Settings" button in the
"User Profiles" section.
- Select the profile I wish to copy for my default user profile. Usually
the top profile, because Administrator is usually what I am using
here - haven't bothered to rename it yet.
- Click on the "Copy To" button.
- Select to copy the profile to
"C:\Documents and Settings\Default User"
- Change the "Permitted to use" to "\Everyone" so anyone who logs in
can use this profile without issue.
- Click OK and wait - doesn't take long since the entire profile
directory is rarely above 1MB.
- Now go to the Default User directory I copied this to and erase the
following:

- C:\Documents and Settings\Default User\Administrator's Documents
- C:\Documents and Settings\Default User\Application Data\Identities
(at least any files/sub-directories under this.)
- C:\Documents and Settings\Default User\UserData
(at least any files/sub-directories under this.)
And a few other directories are slightly modified slightly.

Now I have a default profile for this machine that whenever a user logs in
locally, they have the same settings as anyone else who logs in locally to
this machine. I should point out that there will be no use of a roaming
profile in this situation, and some of these machines would never be
connected to a domain in the first place. I realize some of this can be
done using some complicated "macro scripts" with applications like AutoIt,
but even though AutoIt is nice, it cannot do everything and/or it can fail.
Some of it can be done from the command line, true enough - some cannot. I
was hoping there was already a script I had not found in any of my normal
haunts/searches that did the creation of a default user profile for me.

Hope that better clarifies.
 
B

Brendon Rogers

Replace the C:\Documents and Settings\Default User directory with the custom
you have created. You can script this of course.
 
S

Shenan Stanley

Shenan said:
I would like to be able to create a default user profile as part of
my unattended installs. Is this possible - automagically?

Essentially, I have several different unattended installations that
change fairly often (updates, etc) and I would like to automate
another part of it - the creation of a Default User profile at the
end...

I can make them manually all day - and I suppose I could write a
script using "AutoIt" or something similar to create it that way -
but I thought I would chance that there was some
script.application/helpful individual out there with a better method
to create a default user profile automagically.. =)
Could you clarify what you mean? A Default User profile already
gets created automatically. (At least, I have never seen a system
without one.) What are you trying to automate, precisely?

Shenan said:
Hey Patrick,

Let me start with plugging where your fine work is located:
http://unattended.sourceforge.net/
(For those who don't use an unattended method to install their
systems - why? Do you like the torture? heh)

Yes, I know this, but it is not the default profile with all the
changes I want made to it. I setup a user with all the options and
such that I want them to have. Certain of these settings are on a
per-user basis
and the only way to make sure that a new user to this system has
these settings from the start is to create a default user profile.

(Yes - some of these settings would not be affected by any registry
settings other than those located inside the NTUSER.DAT and/or the
changes in the directories under the user profile itself. I have set
them in the .default user registry, current user registry and local
machine registry without success in some cases and other I am not
sure I would want to try to set that way because of their complicated
situation - involving layouts and such.)

So - I create a default user profile for the machine to make sure
that every user that logs into this machine has these particular
settings.
Of course this is easily accomplished through these steps:

- Setup my current user in the way I want all my users to look/feel.
- Log out and log in as another user (administrative).
- Open the System Properties window.
- Go to the "Advanced" tab, click on the "Settings" button in the
"User Profiles" section.
- Select the profile I wish to copy for my default user profile.
Usually the top profile, because Administrator is usually what I
am using here - haven't bothered to rename it yet.
- Click on the "Copy To" button.
- Select to copy the profile to
"C:\Documents and Settings\Default User"
- Change the "Permitted to use" to "\Everyone" so anyone who logs in
can use this profile without issue.
- Click OK and wait - doesn't take long since the entire profile
directory is rarely above 1MB.
- Now go to the Default User directory I copied this to and erase the
following:

- C:\Documents and Settings\Default User\Administrator's Documents
- C:\Documents and Settings\Default User\Application Data\Identities
(at least any files/sub-directories under this.)
- C:\Documents and Settings\Default User\UserData
(at least any files/sub-directories under this.)
And a few other directories are slightly modified slightly.

Now I have a default profile for this machine that whenever a user
logs in locally, they have the same settings as anyone else who logs
in locally to this machine. I should point out that there will be
no use of a roaming profile in this situation, and some of these
machines would never be connected to a domain in the first place. I
realize some of this can be done using some complicated "macro
scripts" with applications like AutoIt, but even though AutoIt is
nice, it cannot do everything and/or it can fail. Some of it can be
done from the command line, true enough - some cannot. I was hoping
there was already a script I had not found in any of my normal
haunts/searches that did the creation of a default user profile for
me.

Brendon said:
Replace the C:\Documents and Settings\Default User directory with the
custom you have created. You can script this of course.

The point is I want to automate the creation of the default user profile..
Yes - I can create it by hand over and over and over - but at the end of the
unattended - without me doing anything - I want it to take a profile, create
and copy the default user profile from it, and continue on - without my
intervention.

I realize where it goes, and my steps do that for me (see above your
response) - I want to AUTOMATE those steps or substitute them with something
else without human intervention.
 
B

Brendon Rogers

Shenan Stanley said:
The point is I want to automate the creation of the default user profile..
Yes - I can create it by hand over and over and over - but at the end of the
unattended - without me doing anything - I want it to take a profile, create
and copy the default user profile from it, and continue on - without my
intervention.

I realize where it goes, and my steps do that for me (see above your
response) - I want to AUTOMATE those steps or substitute them with something
else without human intervention.

We use RIS to deploy our machines so I am not 100% sure this will work with
unattended installs.

During the RIS process the install calls CMDLINES.TXT.

We use CMDLINES.TXT to call a series of registry patch files e.g.
[Commands]
"regedit /s myRegPatch.reg"

myRegPatch.reg contains entries for HKEY_USERS\.Default.

Additionally, the CMDLINES.TXT file runs under the SYSTEM user context which
uses the Default User profile, so any changes you make (e.g. install
applications) through CMDLINES.TXT will affect the Default User profile.

Otherwise look at GUIRunOnce to call a batchfile which simply deletes the
existing Default User profile then copies your custom one from either a
network location or from the local disk (because you copied it from your
distribution share during the unattended install).

Brendon
 
S

Shenan Stanley

Shenan said:
I setup a user with all the options and
such that I want them to have. Certain of these settings are on a
per-user basis
and the only way to make sure that a new user to this system has
these settings from the start is to create a default user profile.

(Yes - some of these settings would not be affected by any registry
settings other than those located inside the NTUSER.DAT and/or the
changes in the directories under the user profile itself. I have
set them in the .default user registry, current user registry and
local machine registry without success in some cases and other I am
not sure I would want to try to set that way because of their
complicated situation - involving layouts and such.)

So - I create a default user profile for the machine to make sure
that every user that logs into this machine has these particular
settings.
Of course this is easily accomplished through these steps:
<..snip..>
<../snip..>
Now I have a default profile for this machine that whenever a user
logs in locally, they have the same settings as anyone else who logs
in locally to this machine. I should point out that there will be
no use of a roaming profile in this situation, and some of these
machines would never be connected to a domain in the first place. I
realize some of this can be done using some complicated "macro
scripts" with applications like AutoIt, but even though AutoIt is
nice, it cannot do everything and/or it can fail. Some of it can be
done from the command line, true enough - some cannot. I was hoping
there was already a script I had not found in any of my normal
haunts/searches that did the creation of a default user profile for
me.

Brendon said:
Replace the C:\Documents and Settings\Default User directory with
the custom you have created. You can script this of course.

Shenan said:
The point is I want to automate the creation of the default user
profile.. Yes - I can create it by hand over and over and over - but
at the end of the unattended - without me doing anything - I want it
to take a profile, create and copy the default user profile from it,
and continue on - without my intervention.

I realize where it goes, and my steps do that for me (see above your
response) - I want to AUTOMATE those steps or substitute them with
something else without human intervention.

Brendon said:
We use RIS to deploy our machines so I am not 100% sure this will
work with unattended installs.

During the RIS process the install calls CMDLINES.TXT.

We use CMDLINES.TXT to call a series of registry patch files e.g.
[Commands]
"regedit /s myRegPatch.reg"

myRegPatch.reg contains entries for HKEY_USERS\.Default.

Additionally, the CMDLINES.TXT file runs under the SYSTEM user
context which uses the Default User profile, so any changes you make
(e.g. install applications) through CMDLINES.TXT will affect the
Default User profile.

Otherwise look at GUIRunOnce to call a batchfile which simply deletes
the existing Default User profile then copies your custom one from
either a network location or from the local disk (because you copied
it from your distribution share during the unattended install).

I also do this, but there are some settings that cannot be configured by
just registry settings or they cannot be configured in Default User/Current
User and expected to stick.. Quicklaunch bar on, IE Toolbar unlocked, Links
toolbar in IE below the address bar area, icon layout on desktop and in
quicklaunch bar area, Status bar on for Windows Explorer/My Computer,
Detailed view for Windows Explorer/My Computer, Comments column in Windows
Explorer/My Computer turned off, sizes of the columns in Windows Explorer/My
Computer, etc... I can get these things done, but not all through registry
settings that stick in the areas that I would normally use - the registry
file I do apply is quite large at this point as you may well imagine - and
those things I have not found a way to do in that manner. heh

The reason (again) I do not want to make a default profile and store it
somewhere and copy it later is because my unattended installation (and
multiple renditions of it) are very configurable and not static/the same. I
would love for the Default User profile to be created on the fly per
unattended setup, that way any changes I made (Menu Items, things I decided
to put in Send To, etc) don't have to be redone in a new Default User
profile and copied elsewhere - when it might only apply to 2 of the 30
computers I do that week.
 
B

Brendon Rogers

Brendon said:
We use RIS to deploy our machines so I am not 100% sure this will
work with unattended installs.

During the RIS process the install calls CMDLINES.TXT.

We use CMDLINES.TXT to call a series of registry patch files e.g.
[Commands]
"regedit /s myRegPatch.reg"

myRegPatch.reg contains entries for HKEY_USERS\.Default.

Additionally, the CMDLINES.TXT file runs under the SYSTEM user
context which uses the Default User profile, so any changes you make
(e.g. install applications) through CMDLINES.TXT will affect the
Default User profile.

Otherwise look at GUIRunOnce to call a batchfile which simply deletes
the existing Default User profile then copies your custom one from
either a network location or from the local disk (because you copied
it from your distribution share during the unattended install).

I also do this, but there are some settings that cannot be configured by
just registry settings or they cannot be configured in Default User/Current
User and expected to stick.. Quicklaunch bar on, IE Toolbar unlocked, Links
toolbar in IE below the address bar area, icon layout on desktop and in
quicklaunch bar area, Status bar on for Windows Explorer/My Computer,
Detailed view for Windows Explorer/My Computer, Comments column in Windows
Explorer/My Computer turned off, sizes of the columns in Windows Explorer/My
Computer, etc... I can get these things done, but not all through registry
settings that stick in the areas that I would normally use - the registry
file I do apply is quite large at this point as you may well imagine - and
those things I have not found a way to do in that manner. heh

The reason (again) I do not want to make a default profile and store it
somewhere and copy it later is because my unattended installation (and
multiple renditions of it) are very configurable and not static/the same. I
would love for the Default User profile to be created on the fly per
unattended setup, that way any changes I made (Menu Items, things I decided
to put in Send To, etc) don't have to be redone in a new Default User
profile and copied elsewhere - when it might only apply to 2 of the 30
computers I do that week.

We found it wasn't possible to customize the Default User profile during the
actual RIS process (i.e. by creating $OEM$\$1\Documents and Settings\Default
User) because the deployment process overwrote these folders when it created
the Default User profile. So your only option is to customize or replace the
profile later on in the deployment process. I would guess the same thing
applies to UNATTEND.TXT.

If you use CMDLINES.TXT of GUIRunOnce to replace Default User profile from a
network source this gives you the flexibility to update and modify the
central custom profile.

Another alternative is to place the Default User profile into Netlogon on
your DCs. Domain-based PCs will use this profile if it exists to create a
new profile on a PC when a user logs on for the first time.

The items you mention above can all be set through either the registry or
the file system - its just a question of identifying exactly where these
settings are kept. Applications like WinINSTALL or RegMon from
Sysinternals.com might help you here.

Good luck

Brendon
 
P

Patrick J. LoPresti

Shenan Stanley said:
I also do this, but there are some settings that cannot be
configured by just registry settings or they cannot be configured in
Default User/Current User and expected to stick..

Is HKEY_USERS\.DEFAULT supposed to be the same as the NTUSER.DAT hive
in the Default User profile?

I ask because I am pretty sure I have seen cases where they are not.
As in, I edited HKEY_USERS\.DEFAULT and it did not work, but when I
loaded the Default User's NTUSER.DAT hive and made the changes there,
it did work.

Anything you can configure with a per-user registry setting you should
be able to change in the Default User's NTUSER.DAT. And you can
certainly load, edit, and unload that hive from within a script.

- Pat
 
S

sw357mag

I had the same problem and ran across Microsoft's CopyProfile.exe. I
worked much better for me than doing a bunch of sendkeys in WSH.
For more info check out: http://www.jsiinc.com/SUBP/tip7800/rh7830.ht
or http://tinyurl.com/ys2xj



Shenan said:
*I would like to be able to create a default user profile as part o
my
unattended installs. Is this possible - automagically?

Essentially, I have several different unattended installations tha
change
fairly often (updates, etc) and I would like to automate another par
of
it - the creation of a Default User profile at the end...

I can make them manually all day - and I suppose I could write
script
using "AutoIt" or something similar to create it that way - but
thought I
would chance that there was some script.application/helpfu
individual out
there with a better method to create a default user profil
automagically..
=)


-
sw357ma
 

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