Page 1 of 1 1
Topic Options
#157474 - 2006-02-20 02:23 PM Automatically copy the current user's profile to Default User profile
Jeroen Offline
Starting to like KiXtart

Registered: 2001-08-16
Posts: 180
Loc: Netherlands
Hi all,

I've searched around for the last 30mins, but could not find an answer on how to automate copying the currently logged on user's profile to the default user's profile.

We used to do this the dirty way by simply copying the folder contents of the user to the default user folder (and before that used to give 'Everyone' permission in HKCU), but I'd like to clean up our ways with XP. Has anyone got an idea where to start?

I know I can get to the right tab of the System Properties by using
Code:

Rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3



But that would probably mean using SendKeys next, and that's not really the way I would want to do it; it's difficult because you don't know how many accounts exist on the PC, and several things could go wrong. So I prefer a way not using SendKeys. Any help is appreciated!
_________________________
Regards, Jeroen. There are two ways to write error-free programs. Only the third one works.

Top
#157475 - 2006-02-20 03:12 PM Re: Automatically copy the current user's profile to Default User profile
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
First of all, it requires the user to have local admin privileges. Secondly, WHY!? What kind of problem do you try to solve this way? Most likely, there are better ways to solve the problem you're having.
_________________________
There are two types of vessels, submarines and targets.

Top
#157476 - 2006-02-20 03:13 PM Re: Automatically copy the current user's profile to Default User profile
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
AFAIK, you cannot copy a currently in-use profile. You need to be logged on as a different user.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157477 - 2006-02-20 04:36 PM Re: Automatically copy the current user's profile to Default User profile
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
You'll be able to copy most of the files. The most notable exception will be the NTUSER.DAT file which holds the current user's registry settings.

Please tell us what specific problem you try to solve with this rather draconian approach.


Edited by sealeopard (2006-02-20 04:36 PM)
_________________________
There are two types of vessels, submarines and targets.

Top
#157478 - 2006-02-20 11:17 PM Re: Automatically copy the current user's profile to Default User profile
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
If I had to guess, I'd say that he is trying to minimize the pain associated with a domain migration.

I used this method once myself. User logs in, the script logs which profile is being used, script logs off the user and logs in as admin, admin script backs up default profile, admin script copies user profile over to default profile, user logs into the new domain, user now has their old stuff in the new domain.

Top
#157479 - 2006-02-20 11:47 PM Re: Automatically copy the current user's profile to Default User profile
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
and to think ADMT makes all that obsolete.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#157480 - 2006-02-21 12:18 AM Re: Automatically copy the current user's profile to Default User profile
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Yeah, it was a long time ago when I did that.
Top
#157481 - 2006-02-21 01:47 AM Re: Automatically copy the current user's profile to Default User profile
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Quote:

and to think ADMT makes all that obsolete.





Yeah, too bad it doesn't clear out the %TEMP% and IE Cache before doing that copy. On a system that has a 3GB IE Cache and about 1GB of %temp% sure can take a LONG time to copy the profile and may even error out if it runs into any long file name issues due to crap in the IE Cache.
 

A good reason to limit IE Cache on a user desktop to a very small amount.

Top
#157482 - 2006-02-21 02:46 AM Re: Automatically copy the current user's profile to Default User profile
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Actually, ADMT doesn't copy files, it just walks the ACEs for SIDs. IKWYM though, during our AD migration, we could sure tell what machines were clogged up with lots of files.
I use a GPO to set the IE cache to just 32 meg. On my Citrix farm, I set it to delete temp IE files on close.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 128 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.06 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org