Setting a User’s Profile Attributes in a Domain

Posted: January 10, 2010 in Active Directory, Networking, Server, System Information
Tags: , ,


You want to set one or more of the user profile attributes.


Using a graphical user interface
  1. Open the ADUC snap-in.
  2. In the left pane, right-click on the domain and select Find.
  3. Select the appropriate domain beside In.
  4. Beside Name, type the name of the user and click Find Now.
  5. In the Search Results window, double-click on the user.
  6. Click the Profile tab.
  7. Modify the various profile settings as necessary.
  8. Click OK.
Using a command-line interface

You can update a user’s profile attributes using either DSMod or AdMod. DSMod uses the following syntax:

        > dsmod user "<UserDN>" -loscr < 
ScriptPath> -profile < 
        -hmdir <HomeDir> -hmdrv <DriveLetter>

AdMod uses the following syntax:

        > admod b "<UserDN>" <attribute>::<NewValue>
Using VBScript
        ' This code sets the various profile related attributes for a user.
        strUserDN = "<UserDN>" ' e.g. cn=jsmith,cn=Users,dc=rallencorp,dc=com
        set objUser = GetObject("LDAP://" & strUserDN)
        objUser.Put " 
homeDirectory", "\\fileserver\" & objUser.Get("sAMAccountName")
        objUser.Put " 
homeDrive", "z:"
        objUser.Put "profilePath", "\\fileserver\" & _
                    objUser.Get("sAMAccountName") & "\profile"
        objUser.Put "scriptPath", "login.vbs"
        Wscript.Echo "Profile info for " & objUser.Get("sAMAccountName") & " updated"


The four attributes that make up a user’s profile settings include the following:


UNC path to home directory


Drive letter (e.g., Z:) to map home directory


UNC path to profile directory


Path to logon script

When you set the homeDirectory attribute, the folder being referenced needs to already exist.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s