domain user folder naming

Posted on 2004-11-07
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
    LVL 82

    Accepted Solution

    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" (
    LVL 40

    Expert Comment

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

    LVL 82

    Expert Comment

    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

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

    Expert Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
    Learn about cloud computing and its benefits for small business owners.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now