Learn how to a build a cloud-first strategyRegister Now


domain user folder naming

Posted on 2004-11-07
Medium Priority
Last Modified: 2010-04-19
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?

Question by:Rockjodo
  • 3
  • 2
LVL 85

Accepted Solution

oBdA earned 1000 total points
ID: 12517412
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).
LVL 40

Expert Comment

ID: 12517516
And just to followup on oBdA's comment, here is the proper way to copy a profile:


This may help also:

How to Create and Copy Roaming User Profiles in Windows


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....

LVL 85

Expert Comment

ID: 12517567
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
LVL 40

Expert Comment

ID: 12517850
*grin*  But it was such a nice explanation of how these profiles are named..  well done..!!  
LVL 85

Expert Comment

ID: 12518104
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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question