domain user folder naming

When a domain user logs on to the network on a client PC, Windows creates a profile for the domain user on the local system.  IN my limited experience the name of the folder structure that is created is normally Documents and Settings\username.domainname.  

I was doing some testing on one of my desktop systems to find the most effective way to copy local user profiles to domain user profiles and in the process copied a local profile to username.domainname - like Smith.Mydomain.  When the user Smith logged in on the PC (for the first time) that already had a Documents and Settings\Smith.Mydomain,  Windows created a Documents and Settings\Smith.Mydomain.000    I figured this was OK - BUT, every subsequent domain user that logs onto this PC gets a profile created with the folder name = Documents and Settings\username    - Windows is leaving off the domainname suffix !

Now I like being able to look in Documents and Settings to see who the local and the domain users are.  How do I fix this so that Windows starts adding the .domainname suffix again?

RockjodoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Windows has its own system to create the profile's name. It usually tries to start with just Username; if a profile of that name is already there, and the user logging on is a domain member, it tries Username.Domain; at some point, it will start adding numbers. In addition, if you change a user name, the user's profile name will stay the same; a user profile is tied to the user's SID, not the user's name.
There's no way to force Windows to create a specific profile folder name.
So the bad news is, there is absolutely no way to determine which user has which profile by simply looking into the Documents and Settings folder.
To determine the user's profile path when the user is logged on, use the environment variable %UserProfile% (never, ever, use C:\Documents and Settings\%UserName%).
If you're logged on as Administrator and want to determine which profile belongs to which user, you'll have to look in the registry, at HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList. Here you will find a number of keys with the SIDs of accounts with profiles on this machine.
Under the SID key, you'll find a value "ProfileImagePath", which points to the user's profile.
To actually determine which SID belongs to which user account, you can use, for example, Sysinternal's "PsGetSID" (http://www.sysinternals.com/ntw2k/freeware/psgetsid.shtml).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fatal_ExceptionSystems EngineerCommented:
And just to followup on oBdA's comment, here is the proper way to copy a profile:

http://www.petri.co.il/copy_user_profiles_in_windows_xp.htm

This may help also:

How to Create and Copy Roaming User Profiles in Windows

http://support.microsoft.com/default.aspx?scid=kb;EN-US;142682

Be aware that you must be logged in as the administrator, and not the user you wish to copy the profile from for this to work....

FE
0
oBdACommented:
Stupid me, forgot the "copy" part while explaining the user profile naming; Fatal_Exception is of course right when it comes to the actual copying.
For a mass profile change, you might want to have a look at moveuser.exe from the Resource Kit Tools:
Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
0
Fatal_ExceptionSystems EngineerCommented:
*grin*  But it was such a nice explanation of how these profiles are named..  well done..!!  
0
oBdACommented:
Actually, I just thought of a rather easy solution to find out which profile belongs to which user (assuming you're using standard NTFS permissions).
Open the security settings of the profile folder, and check who (apart from Administrators and System) has Full Control over the folder; there should only be one account.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.