1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
7 <chapter id="ProfileMgmt">
10 <pubdate>April 3 2003</pubdate>
13 <title>Desktop Profile Management</title>
16 <title>Features and Benefits</title>
19 Roaming profiles are feared by some, hated by a few, loved by many, and a Godsend for
24 Roaming profiles allow an administrator to make available a consistent user desktop
25 as the user moves from one machine to another. This chapter provides much information
26 regarding how to configure and manage roaming profiles.
30 While roaming profiles might sound like nirvana to some, they are a real and tangible
31 problem to others. In particular, users of mobile computing tools, where often there may not
32 be a sustained network connection, are often better served by purely local profiles.
33 This chapter provides information to help the Samba administrator deal with those
40 <title>Roaming Profiles</title>
44 Roaming profiles support is different for Windows 9x/Me and Windows NT4/200x.
49 Before discussing how to configure roaming profiles, it is useful to see how
50 Windows 9x/Me and Windows NT4/200x clients implement these features.
54 Windows 9x/Me clients send a NetUserGetInfo request to the server to get the user's
55 profiles location. However, the response does not have room for a separate
56 profiles location field, only the user's home share. This means that Windows 9x/Me
57 profiles are restricted to being stored in the user's home directory.
62 Windows NT4/200x clients send a NetSAMLogon RPC request, which contains many fields
63 including a separate field for the location of the user's profiles.
67 <title>Samba Configuration for Profile Handling</title>
70 This section documents how to configure Samba for MS Windows client profile support.
74 <title>NT4/200x User Profiles</title>
77 For example, to support Windows NT4/200x clients, set the followoing in the [global] section of the &smb.conf; file:
82 <smbconfoption><name>logon path</name><value> </value></smbconfoption>
83 <member><parameter>\\profileserver\profileshare\profilepath\%U\moreprofilepath</parameter></member>
86 This is typically implemented like:
89 <smbconfoption><name>logon path</name><value>\\%L\Profiles\%u</value></smbconfoption>
91 where <quote>%L</quote> translates to the name of the Samba server and <quote>%u</quote> translates to the user name.
95 The default for this option is <filename>\\%N\%U\profile</filename>, namely <filename>\\sambaserver\username\profile</filename>.
96 The <filename>\\%N\%U</filename> service is created automatically by the [homes] service. If you are using
97 a Samba server for the profiles, you must make the share that is specified in the logon path
98 browseable. Please refer to the man page for &smb.conf; in respect of the different
99 semantics of <quote>%L</quote> and <quote>%N</quote>, as well as <quote>%U</quote> and <quote>%u</quote>.
104 MS Windows NT/200x clients at times do not disconnect a connection to a server between logons. It is recommended
105 to not use the <smbconfsection>homes</smbconfsection> meta-service name as part of the profile share path.
111 <title>Windows 9x/Me User Profiles</title>
114 To support Windows 9x/Me clients, you must use the <smbconfoption><name>logon home</name></smbconfoption>
115 parameter. Samba has been fixed so <userinput>net use /home</userinput> now works as well and it, too, relies
116 on the <command>logon home</command> parameter.
120 By using the logon home parameter, you are restricted to putting Windows 9x/Me profiles in the user's home
121 directory. But wait! There is a trick you can use. If you set the following in the
122 <smbconfsection>[global]</smbconfsection> section of your &smb.conf; file:
125 <smbconfoption><name>logon home</name><value>\\%L\%U\.profiles</value></smbconfoption>
126 </smbconfblock></para>
129 then your Windows 9x/Me clients will dutifully put their clients in a subdirectory
130 of your home directory called <filename>.profiles</filename> (making them hidden).
134 Not only that, but <userinput>net use /home</userinput> will also work because of a feature in
135 Windows 9x/Me. It removes any directory stuff off the end of the home directory area
136 and only uses the server and share portion. That is, it looks like you
137 specified <filename>\\%L\%U</filename> for <smbconfoption><name>logon home</name></smbconfoption>.
142 <title>Mixed Windows 9x/Me and Windows NT4/200x User Profiles</title>
145 You can support profiles for Windows 9x and Windows NT clients by setting both the
146 <smbconfoption><name>logon home</name></smbconfoption> and <smbconfoption><name>logon path</name></smbconfoption> parameters. For example:
150 <smbconfoption><name>logon home</name><value>\\%L\%u\.profiles</value></smbconfoption>
151 <smbconfoption><name>logon path</name><value>\\%L\profiles\%u</value></smbconfoption>
152 </smbconfblock></para>
156 <title>Disabling Roaming Profile Support</title>
159 A question often asked is: <quote>How may I enforce use of local profiles?</quote> or
160 <quote>How do I disable roaming profiles?</quote>
164 <indexterm><primary>roaming profiles</primary></indexterm>
165 There are three ways of doing this:
166 <indexterm><primary>windows registry settings</primary><secondary>roaming profiles</secondary></indexterm>
172 <term>In &smb.conf;</term>
174 Affect the following settings and ALL clients will be forced to use a local profile:
175 <smbconfoption><name>logon home</name><value> </value></smbconfoption> and <smbconfoption><name>logon path</name><value> </value></smbconfoption>
179 The arguments to these parameters must be left blank. It is necessary to include the <constant>=</constant> sign
180 to specifically assign the empty value.
185 <term>MS Windows Registry</term>
187 By using the Microsoft Management Console gpedit.msc to instruct your MS Windows XP
188 machine to use only a local profile. This, of course, modifies registry settings. The full
189 path to the option is:
191 Local Computer Policy\
192 Computer Configuration\
193 Administrative Templates\
197 Disable: Only Allow Local User Profiles
198 Disable: Prevent Roaming Profile Change from Propagating to the Server
204 <term>Change of Profile Type:</term>
205 <listitem><para>From the start menu right-click on <guiicon>My Computer icon</guiicon>,
206 select <guimenuitem>Properties</guimenuitem>, click on the <guilabel>User Profiles</guilabel>
207 tab, select the profile you wish to change from
208 <guimenu>Roaming</guimenu> type to <guimenu>Local</guimenu>, and click on
209 <guibutton>Change Type</guibutton>.
215 Consult the MS Windows registry guide for your particular MS Windows version for more information
216 about which registry keys to change to enforce use of only local user profiles.
220 The specifics of how to convert a local profile to a roaming profile, or a roaming profile
221 to a local one vary according to the version of MS Windows you are running. Consult the Microsoft MS
222 Windows Resource Kit for your version of Windows for specific information.
227 <sect2> <title>Windows Client Profile Configuration Information</title>
229 <sect3> <title>Windows 9x/Me Profile Setup</title>
232 When a user first logs in on Windows 9X, the file user.DAT is created, as are folders
233 <filename>Start Menu</filename>, <filename>Desktop</filename>, <filename>Programs</filename>, and
234 <filename>Nethood</filename>. These directories and their contents will be merged with the local
235 versions stored in <filename>c:\windows\profiles\username</filename> on subsequent logins, taking the
236 most recent from each. You will need to use the <smbconfsection>[global]</smbconfsection> options
237 <smbconfoption><name>preserve case</name><value>yes</value></smbconfoption>,
238 <smbconfoption><name>short preserve case</name><value>yes</value></smbconfoption> and
239 <smbconfoption><name>case sensitive</name><value>no</value></smbconfoption>
240 in order to maintain capital letters in shortcuts in any of the profile folders.
244 The <filename>user.DAT</filename> file contains all the user's preferences. If you wish to enforce a set of preferences,
245 rename their <filename>user.DAT</filename> file to <filename>user.MAN</filename>, and deny them write access to this file.
250 On the Windows 9x/Me machine, go to <guimenu>Control Panel</guimenu> ->
251 <guimenuitem>Passwords</guimenuitem> and select the <guilabel>User Profiles</guilabel> tab.
252 Select the required level of roaming preferences. Press <guibutton>OK</guibutton>, but do not
253 allow the computer to reboot.
257 On the Windows 9x/Me machine, go to <guimenu>Control Panel</guimenu> ->
258 <guimenuitem>Network</guimenuitem> -> <guimenuitem>Client for Microsoft Networks</guimenuitem>
259 -> <guilabel>Preferences</guilabel>. Select <guilabel>Log on to NT Domain</guilabel>. Then,
260 ensure that the Primary Logon is <guilabel>Client for Microsoft Networks</guilabel>. Press
261 <guibutton>OK</guibutton>, and this time allow the computer to reboot.
265 <para> Under Windows 9x/ME, profiles are downloaded from the Primary Logon. If you have the Primary Logon
266 as <quote>Client for Novell Networks</quote>, then the profiles and logon script will be downloaded from
267 your Novell Server. If you have the Primary Logon as <quote>Windows Logon</quote>, then the profiles will
268 be loaded from the local machine &smbmdash; a bit against the concept of roaming profiles, it would seem! </para>
271 You will now find that the Microsoft Networks Login box contains <constant>[user, password, domain]</constant> instead
272 of just <constant>[user, password]</constant>. Type in the Samba server's domain name (or any other domain known to exist,
273 but bear in mind that the user will be authenticated against this domain and profiles downloaded from it,
274 if that domain logon server supports it), user name and user's password.
277 <para> Once the user has been successfully validated, the Windows 9x/Me machine will inform you that
278 <computeroutput>The user has not logged on before</computeroutput> and asks you <computeroutput>Do you
279 wish to save the user's preferences?</computeroutput> Select <guibutton>Yes</guibutton>. </para>
281 <para> Once the Windows 9x/Me client comes up with the desktop, you should be able to examine the
282 contents of the directory specified in the <smbconfoption><name>logon path</name></smbconfoption> on
283 the Samba server and verify that the <filename>Desktop</filename>, <filename>Start Menu</filename>,
284 <filename>Programs</filename> and <filename>Nethood</filename> folders have been created. </para>
286 <para> These folders will be cached locally on the client, and updated when the user logs off (if
287 you haven't made them read-only by then). You will find that if the user creates further folders or
288 shortcut, that the client will merge the profile contents downloaded with the contents of the profile
289 directory already on the local client, taking the newest folders and shortcut from each set. </para>
291 <para> If you have made the folders/files read-only on the Samba server, then you will get errors from
292 the Windows 9x/Me machine on logon and logout as it attempts to merge the local and remote profile.
293 Basically, if you have any errors reported by the Windows 9x/Me machine, check the UNIX file permissions
294 and ownership rights on the profile directory contents, on the Samba server. </para>
296 <para> If you have problems creating user profiles, you can reset the user's local desktop cache, as
297 shown below. When this user next logs in, the user will be told that he/she is logging in <quote>for
298 the first time</quote>.
300 <indexterm><primary>windows registry settings</primary><secondary>profile path</secondary></indexterm>
306 Instead of logging in under the [user, password, domain] dialog, press <guibutton>escape</guibutton>.
310 Run the <command>regedit.exe</command> program, and look in:
314 <filename>HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList</filename>
318 You will find an entry for each user of ProfilePath. Note the contents of this key
319 (likely to be <filename>c:\windows\profiles\username</filename>), then delete the key
320 <parameter>ProfilePath</parameter> for the required user.
324 Exit the registry editor.
328 Search for the user's .PWL password-caching file in the <filename>c:\windows</filename> directory, and delete it.
332 Log off the Windows 9x/Me client.
336 Check the contents of the profile path (see <smbconfoption><name>logon path</name></smbconfoption>
337 described above) and delete the <filename>user.DAT</filename> or <filename>user.MAN</filename>
338 file for the user, making a backup if required.
343 Before deleting the contents of the directory listed in the <parameter>ProfilePath</parameter>
344 (this is likely to be <filename>c:\windows\profiles\username)</filename>, ask the owner if they have
345 any important files stored on their desktop or in their start menu. Delete the contents of the
346 directory <parameter>ProfilePath</parameter> (making a backup if any of the files are needed).
350 This will have the effect of removing the local (read-only hidden system file) <filename>user.DAT</filename>
351 in their profile directory, as well as the local <quote>desktop,</quote> <quote>nethood,</quote>
352 <quote>start menu,</quote> and <quote>programs</quote> folders.
356 If all else fails, increase Samba's debug log levels to between 3 and 10, and/or run a packet
357 sniffer program such as ethereal or <command>netmon.exe</command>, and look for error messages.
360 <para> If you have access to an Windows NT4/200x server, then first set up roaming profiles and/or
361 netlogons on the Windows NT4/200x server. Make a packet trace, or examine the example packet traces
362 provided with Windows NT4/200x server, and see what the differences are with the equivalent Samba trace.
368 <title>Windows NT4 Workstation</title>
370 <para> When a user first logs in to a Windows NT Workstation, the profile NTuser.DAT is created. The profile
371 location can be now specified through the <smbconfoption><name>logon path</name></smbconfoption> parameter.
374 <para> There is a parameter that is now available for use with NT Profiles: <smbconfoption><name>logon drive</name></smbconfoption>.
375 This should be set to <filename>H:</filename> or any other drive, and should be used in conjunction with
376 the new <smbconfoption><name>logon home</name></smbconfoption> parameter. </para>
378 <para> The entry for the NT4 profile is a directory not a file. The NT help on Profiles mentions that a
379 directory is also created with a .PDS extension. The user, while logging in, must have write permission
380 to create the full profile path (and the folder with the .PDS extension for those situations where it
381 might be created.) </para>
383 <para> In the profile directory, Windows NT4 creates more folders than Windows 9x/Me. It creates
384 <filename>Application Data</filename> and others, as well as <filename>Desktop</filename>,
385 <filename>Nethood</filename>, <filename>Start Menu,</filename> and <filename>Programs</filename>.
386 The profile itself is stored in a file <filename>NTuser.DAT</filename>. Nothing appears to be stored
387 in the .PDS directory, and its purpose is currently unknown. </para>
389 <para> You can use the <application>System Control Panel</application> to copy a local profile onto
390 a Samba server (see NT Help on Profiles; it is also capable of firing up the correct location in the
391 <application>System Control Panel</application> for you). The NT Help file also mentions that renaming
392 <filename>NTuser.DAT</filename> to <filename>NTuser.MAN</filename> turns a profile into a mandatory one.
395 <para> The case of the profile is significant. The file must be called <filename>NTuser.DAT</filename>
396 or, for a mandatory profile, <filename>NTuser.MAN</filename>. </para> </sect3>
398 <sect3> <title>Windows 2000/XP Professional</title>
400 <para> You must first convert the profile from a local profile to a domain profile on the MS Windows
401 workstation as follows: </para>
404 <step><para> Log on as the <emphasis>local</emphasis> workstation administrator. </para></step>
406 <step><para> Right-click on the <guiicon>My Computer</guiicon> Icon, select
407 <guimenuitem>Properties</guimenuitem>.</para></step>
409 <step><para> Click on the <guilabel>User Profiles</guilabel> tab.</para></step>
411 <step><para> Select the profile you wish to convert (click it once).</para></step>
413 <step><para> Click on the <guibutton>Copy To</guibutton> button.</para></step>
415 <step><para> In the <guilabel>Permitted to use</guilabel> box, click on the
416 <guibutton>Change</guibutton> button. </para></step>
418 <step><para> Click on the <guilabel>Look in</guilabel> area that lists the machine name. When you click here, it will
419 open up a selection box. Click on the domain to which the profile must be accessible. </para>
421 <note><para>You will need to log on if a logon box opens up.
422 For example, connect as <replaceable>DOMAIN</replaceable>\root, password:
423 <replaceable>mypassword</replaceable>.</para></note> </step>
425 <step><para> To make the profile capable of being used by anyone, select <quote>Everyone</quote>. </para></step>
427 <step><para> Click on <guibutton>OK</guibutton> and the Selection box will close. </para></step>
429 <step><para> Now click on <guibutton>OK</guibutton> to create the profile in the path
430 you nominated. </para></step>
433 <para> Done. You now have a profile that can be edited using the Samba <command>profiles</command> tool.
437 Under Windows NT/200x, the use of mandatory profiles forces the use of MS Exchange storage of mail
438 data and keeps it out of the desktop profile. That keeps desktop profiles from becoming unusable.
442 <title>Windows XP Service Pack 1</title>
444 There is a security check new to Windows XP (or maybe only Windows XP service pack 1).
445 It can be disabled via a group policy in the Active Directory. The policy is called:
449 <filename>Computer Configuration\Administrative Templates\System\User Profiles\<?latex \linebreak ?>Do not check for
450 user ownership of Roaming Profile Folders</filename>i
454 This should be set to <constant>Enabled</constant>.
458 Does the new version of Samba have an Active Directory analogue? If so, then you may be able to set the policy through this.
461 <para>If you cannot set group policies in Samba, then you may be able to set the policy locally on
462 each machine. If you want to try this, then do the following (N.B. I do not know for sure that this
463 will work in the same way as a domain group policy):
468 <step><para>On the XP workstation, log in with an Administrative account.</para></step>
470 <step><para>Click on <guimenu>Start</guimenu> -> <guimenuitem>Run</guimenuitem>.</para></step>
471 <step><para>Type <command>mmc</command>.</para></step>
472 <step><para>Click on <guibutton>OK</guibutton>.</para></step>
473 <step><para>A Microsoft Management Console should appear.</para></step>
474 <step><para>Click on <guimenu>File</guimenu> -> <guimenuitem>Add/Remove Snap-in</guimenuitem> -> <guimenuitem>Add</guimenuitem>.</para></step>
475 <step><para>Double-click on <guiicon>Group Policy</guiicon>.</para></step>
476 <step><para>Click on <guibutton>Finish</guibutton> -> <guibutton>Close</guibutton>.</para></step>
477 <step><para>Click on <guibutton>OK</guibutton>.</para></step>
478 <step><para>In the <quote>Console Root</quote> window expand <guiicon>Local Computer Policy</guiicon> ->
479 <guiicon>Computer Configuration</guiicon> -> <guiicon>Administrative Templates</guiicon> ->
480 <guiicon>System</guiicon> -> <guiicon>User Profiles</guiicon>.</para></step>
481 <step><para>Double-click on <guilabel>Do not check for user ownership of Roaming Profile Folders</guilabel>.</para></step>
482 <step><para>Select <guilabel>Enabled</guilabel>.</para></step>
483 <step><para>Click on <guibutton>OK</guibutton>.</para></step>
484 <step><para>Close the whole console. You do not need to save the settings (this refers to the
485 console settings rather than the policies you have changed).</para></step>
486 <step><para>Reboot.</para></step>
493 <title>Sharing Profiles between W9x/Me and NT4/200x/XP Workstations</title>
495 <para> Sharing of desktop profiles between Windows versions is not recommended. Desktop profiles are an
496 evolving phenomenon and profiles for later versions of MS Windows clients add features that may interfere
497 with earlier versions of MS Windows clients. Probably the more salient reason to not mix profiles is
498 that when logging off an earlier version of MS Windows, the older format of profile contents may overwrite
499 information that belongs to the newer version resulting in loss of profile information content when that
500 user logs on again with the newer version of MS Windows. </para>
502 <para> If you then want to share the same Start Menu/Desktop with W9x/Me, you will need to specify a common
503 location for the profiles. The &smb.conf; parameters that need to be common are
504 <smbconfoption><name>logon path</name></smbconfoption> and
505 <smbconfoption><name>logon home</name></smbconfoption>. </para>
507 <para> If you have this set up correctly, you will find separate <filename>user.DAT</filename> and
508 <filename>NTuser.DAT</filename> files in the same profile directory. </para>
513 <title>Profile Migration from Windows NT4/200x Server to Samba</title>
515 <para> There is nothing to stop you from specifying any path that you like for the location of users' profiles.
516 Therefore, you could specify that the profile be stored on a Samba server, or any other SMB server,
517 as long as that SMB server supports encrypted passwords. </para>
520 <title>Windows NT4 Profile Management Tools</title>
522 <para> Unfortunately, the Resource Kit information is specific to the version of MS Windows NT4/200x. The
523 correct resource kit is required for each platform. </para>
525 <para>Here is a quick guide:</para>
528 <step><para> On your NT4 Domain Controller, right click on <guiicon>My Computer</guiicon>, then select the
529 tab labeled <guilabel>User Profiles</guilabel>. </para></step>
531 <step><para> Select a user profile you want to migrate and click on it. </para>
533 <note><para>I am using the term <quote>migrate</quote> loosely. You can copy a profile to create a group
534 profile. You can give the user <parameter>Everyone</parameter> rights to the profile you copy this to. That
535 is what you need to do, since your Samba domain is not a member of a trust relationship with your NT4
536 PDC.</para></note></step>
538 <step><para>Click on the <guibutton>Copy To</guibutton> button.</para></step>
540 <step><para>In the box labeled <guilabel>Copy Profile to</guilabel> add your new path, e.g.,
541 <filename>c:\temp\foobar</filename></para></step>
543 <step><para>Click on <guibutton>Change</guibutton> in the <guilabel>Permitted to use</guilabel> box.</para></step>
545 <step><para>Click on the group <quote>Everyone</quote>, click on <guibutton>OK</guibutton>. This
546 closes the <quote>choose user</quote> box.</para></step>
548 <step><para>Now click on <guibutton>OK</guibutton>.</para></step>
551 <para> Follow the above for every profile you need to migrate. </para>
556 <title>Side Bar Notes</title>
560 <indexterm><primary>SID</primary></indexterm>
561 You should obtain the SID of your NT4 domain. You can use smbpasswd to do this. Read the man
566 <sect3> <title>moveuser.exe</title>
568 <para> The Windows 200x professional resource kit has <command>moveuser.exe</command>. <command>moveuser.exe</command> changes the security of a profile
569 from one user to another. This allows the account domain to change, and/or the user name to change.</para>
572 This command is like the Samba <command>profiles</command> tool.
578 <title>Get SID</title>
581 <indexterm><primary>SID</primary></indexterm>
582 You can identify the SID by using <command>GetSID.exe</command> from the Windows NT Server 4.0 Resource Kit. </para>
584 <para> Windows NT 4.0 stores the local profile information in the registry under the following key:
585 <filename>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</filename> </para>
587 <para> Under the ProfileList key, there will be subkeys named with the SIDs of the users who have logged
588 on to this computer. (To find the profile information for the user whose locally cached profile you want
589 to move, find the SID for the user with the <command>GetSID.exe</command> utility.) Inside the appropriate user's subkey,
590 you will see a string value named <parameter>ProfileImagePath</parameter>. </para>
592 </sect3> </sect2> </sect1>
594 <sect1> <title>Mandatory Profiles</title>
597 <indexterm><primary>mandatory profiles</primary></indexterm>
598 A Mandatory Profile is a profile that the user does not have the ability to overwrite. During the
599 user's session, it may be possible to change the desktop environment, however, as the user logs out all changes
600 made will be lost. If it is desired to not allow the user any ability to change the desktop environment,
601 then this must be done through policy settings. See the previous chapter. </para>
603 <note><para> Under NO circumstances should the profile directory (or its
604 contents) be made read-only as this may render the profile un-usable.
605 Where it is essential to make a profile read-only within the UNIX file
606 system, this can be done but then you absolutely must use the
607 <command>fake-permissions</command> VFS module to instruct MS Windows
608 NT/200x/XP clients that the Profile has write permission for the user.
609 See <link linkend="fakeperms">fake_perms VFS module</link>. </para></note>
611 <para> For MS Windows NT4/200x/XP, the above method can also be used to create mandatory profiles. To
612 convert a group profile into a mandatory profile, simply locate the <filename>NTUser.DAT</filename> file in the copied profile
613 and rename it to <filename>NTUser.MAN</filename>. </para>
615 <para> For MS Windows 9x/ME, it is the <filename>User.DAT</filename> file that must be renamed to
616 <filename>User.MAN</filename> to effect a mandatory profile. </para>
621 <title>Creating and Managing Group Profiles</title>
624 <indexterm><primary>group profiles</primary></indexterm>
625 Most organizations are arranged into departments. There is a nice benefit in this fact since usually
626 most users in a department require the same desktop applications and the same desktop layout. MS
627 Windows NT4/200x/XP will allow the use of Group Profiles. A Group Profile is a profile that is created
628 first using a template (example) user. Then using the profile migration tool (see above), the profile is
629 assigned access rights for the user group that needs to be given access to the group profile. </para>
631 <para> The next step is rather important. Instead of assigning a group profile to users (Using User Manager)
632 on a <quote>per user</quote> basis, the group itself is assigned the now modified profile. </para>
635 <para> Be careful with Group Profiles. If the user who is a member of a group also has a personal
636 profile, then the result will be a fusion (merge) of the two. </para>
642 <title>Default Profile for Windows Users</title>
645 <indexterm><primary>default profile</primary></indexterm>
646 MS Windows 9x/Me and NT4/200x/XP will use a default profile for any user for whom a profile
647 does not already exist. Armed with a knowledge of where the default profile is located on the Windows
648 workstation, and knowing which registry keys effect the path from which the default profile is created,
649 it is possible to modify the default profile to one that has been optimized for the site. This has
650 significant administrative advantages. </para>
653 <title>MS Windows 9x/Me</title>
655 <para> To enable default per use profiles in Windows 9x/ME, you can either use the <application>Windows
656 98 System Policy Editor</application> or change the registry directly. </para>
658 <para> To enable default per user profiles in Windows 9x/ME, launch the <application>System Policy
659 Editor</application>, then select <guimenu>File</guimenu> -> <guimenuitem>Open Registry</guimenuitem>,
660 next click on the <guiicon>Local Computer</guiicon> icon, click on <guilabel>Windows 98 System</guilabel>,
661 select <guilabel>User Profiles</guilabel>, and click on the enable box. Remember to save the registry
664 <para> To modify the registry directly, launch the <application>Registry Editor</application>
665 (<command>regedit.exe</command>) and select the hive <filename>HKEY_LOCAL_MACHINE\Network\Logon</filename>. Now
666 add a DWORD type key with the name <quote>User Profiles,</quote> to
667 enable user profiles to set the value
668 to 1; to disable user profiles set it to 0. </para>
671 <title>User Profile Handling with Windows 9x/Me</title>
673 <para> When a user logs on to a Windows 9x/Me machine, the local profile path,
674 <filename>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProfileList</filename>, is checked
675 for an existing entry for that user. </para>
677 <para> If the user has an entry in this registry location, Windows 9x/Me checks for a locally cached
678 version of the user profile. Windows 9x/Me also checks the user's home directory (or other specified
679 directory if the location has been modified) on the server for the User Profile. If a profile exists
680 in both locations, the newer of the two is used. If the User Profile exists on the server, but does not
681 exist on the local machine, the profile on the server is downloaded and used. If the User Profile only
682 exists on the local machine, that copy is used. </para>
684 <para> If a User Profile is not found in either location, the Default User Profile from the Windows
685 9x/Me machine is used and copied to a newly created folder for the logged on user. At log off, any
686 changes that the user made are written to the user's local profile. If the user has a roaming profile,
687 the changes are written to the user's profile on the server. </para>
692 <title>MS Windows NT4 Workstation</title>
694 <para> On MS Windows NT4, the default user profile is obtained from the location
695 <filename>%SystemRoot%\Profiles</filename> which in a default installation will translate to
696 <filename>C:\Windows NT\Profiles</filename>. Under this directory on a clean install there will be three
697 (3) directories: <filename>Administrator</filename>, <filename>All
698 Users,</filename> and <filename>Default
699 User</filename>. </para>
701 <para> The <filename>All Users</filename> directory contains menu settings that are common across all
702 system users. The <filename>Default User</filename> directory contains menu entries that are customizable
703 per user depending on the profile settings chosen/created. </para>
705 <para> When a new user first logs onto an MS Windows NT4 machine, a new profile is created from: </para>
708 <listitem><para>All Users settings.</para></listitem>
709 <listitem><para>Default User settings (contains the default <filename>NTUser.DAT</filename> file).</para></listitem>
712 <para> When a user logs onto an MS Windows NT4 machine that is a member of a Microsoft security domain,
713 the following steps are followed in respect of profile handling:
715 <indexterm><primary>NTConfig.POL</primary></indexterm>
720 <step> <para> The users' account information that is obtained during the logon process
721 contains the location of the users' desktop profile. The profile path may be local to
722 the machine or it may be located on a network share. If there exists a profile at the
723 location of the path from the user account, then this profile is copied to the location
724 <filename>%SystemRoot%\Profiles\%USERNAME%</filename>. This profile then inherits the settings
725 in the <filename>All Users</filename> profile in the <filename>%SystemRoot%\Profiles</filename>
726 location. </para> </step>
728 <step> <para> If the user account has a profile path, but at its location a profile does not
729 exist, then a new profile is created in the <filename>%SystemRoot%\Profiles\%USERNAME%</filename>
730 directory from reading the <filename>Default User</filename> profile. </para> </step>
732 <step> <para> If the NETLOGON share on the authenticating server (logon server) contains
733 a policy file (<filename>NTConfig.POL</filename>), then its contents are applied to the
734 <filename>NTUser.DAT</filename> which is applied to the <filename>HKEY_CURRENT_USER</filename>
735 part of the registry.
738 <step> <para> When the user logs out, if the profile is set to be a roaming profile it will be
739 written out to the location of the profile. The <filename>NTuser.DAT</filename> file is then
740 recreated from the contents of the <filename>HKEY_CURRENT_USER</filename> contents. Thus,
741 should there not exist in the NETLOGON share an <filename>NTConfig.POL</filename> at the next
742 logon, the effect of the previous <filename>NTConfig.POL</filename> will still be held in the
743 profile. The effect of this is known as tattooing.
747 <para> MS Windows NT4 profiles may be <emphasis>local</emphasis> or <emphasis>roaming</emphasis>. A local
748 profile will stored in the <filename>%SystemRoot%\Profiles\%USERNAME%</filename> location. A roaming
749 profile will also remain stored in the same way, unless the following registry key is created as shown: </para>
751 <para><screen> HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\Windows NT\CurrentVersion\
752 winlogon\"DeleteRoamingCache"=dword:0000000
754 In this case, the local copy (in <filename>%SystemRoot%\Profiles\%USERNAME%</filename>) will be deleted
757 <para> Under MS Windows NT4, default locations for common resources like <filename>My Documents</filename>
758 may be redirected to a network share by modifying the following registry keys. These changes may be
759 affected via use of the System Policy Editor. To do so may require that you create your own template
760 extension for the policy editor to allow this to be done through the GUI. Another way to do this is by
761 way of first creating a default user profile, then while logged in as that user, run <command>regedt32</command> to edit
762 the key settings. </para>
765 The Registry Hive key that affects the behavior of folders that are part of the default user
766 profile are controlled by entries on Windows NT4 is:
776 <indexterm><primary>windows registry settings</primary><secondary>default profile locations</secondary></indexterm>
779 <para> The above hive key contains a list of automatically managed
780 folders. The default entries are shown in <link linkend="ProfileLocs">the next table</link>.
783 <table frame="all" id="ProfileLocs">
784 <title>User Shell Folder Registry Keys Default Values</title>
786 <colspec align="left"/>
787 <colspec align="left"/>
789 <row><entry>Name</entry><entry>Default Value</entry></row>
792 <row><entry>AppData</entry><entry>%USERPROFILE%\Application Data</entry></row>
793 <row><entry>Desktop</entry><entry>%USERPROFILE%\Desktop</entry></row>
794 <row><entry>Favorites</entry><entry>%USERPROFILE%\Favorites</entry></row>
795 <row><entry>NetHood</entry><entry>%USERPROFILE%\NetHood</entry></row>
796 <row><entry>PrintHood</entry><entry>%USERPROFILE%\PrintHood</entry></row>
797 <row><entry>Programs</entry><entry>%USERPROFILE%\Start Menu\Programs</entry></row>
798 <row><entry>Recent</entry><entry>%USERPROFILE%\Recent</entry></row>
799 <row><entry>SendTo</entry><entry>%USERPROFILE%\SendTo</entry></row>
800 <row><entry>Start Menu </entry><entry>%USERPROFILE%\Start Menu</entry></row>
801 <row><entry>Startup</entry><entry>%USERPROFILE%\Start Menu\Programs\Startup</entry></row>
806 <para> The registry key that contains the location of the default profile settings is: </para>
808 <para> <filename>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\<?latex \linebreak ?>
809 User Shell Folders</filename> </para>
811 <para> The default entries are shown in <link linkend="regkeys">the next table</link>.</para>
813 <table frame="all" id="regkeys">
814 <title>Defaults of Profile Settings Registry Keys</title>
816 <colspec align="left"/>
817 <colspec align="left"/>
819 <row><entry>Common Desktop</entry><entry>%SystemRoot%\Profiles\All Users\Desktop</entry></row>
820 <row><entry>Common Programs</entry><entry>%SystemRoot%\Profiles\All Users\Programs</entry></row>
821 <row><entry>Common Start Menu</entry><entry>%SystemRoot%\Profiles\All Users\Start Menu</entry></row>
822 <row><entry>Common Startup</entry><entry>%SystemRoot%\Profiles\All Users\Start Menu\Programs\Startup</entry></row>
829 <sect2> <title>MS Windows 200x/XP</title>
832 <indexterm><primary>GPOs</primary></indexterm>
833 MS Windows XP Home Edition does use default per user profiles, but cannot participate
834 in domain security, cannot log onto an NT/ADS-style domain, and thus can obtain the profile only
835 from itself. While there are benefits in doing this, the beauty of those MS Windows clients that
836 can participate in domain logon processes allows the administrator to create a global default
837 profile and enforce it through the use of Group Policy Objects (GPOs).
840 <para> When a new user first logs onto an MS Windows 200x/XP machine, the default profile is obtained from
841 <filename>C:\Documents and Settings\Default User</filename>. The administrator can modify or change the
842 contents of this location and MS Windows 200x/XP will gladly use it. This is far from the optimum arrangement
843 since it will involve copying a new default profile to every MS Windows 200x/XP client workstation. </para>
845 <para> When MS Windows 200x/XP participates in a domain security context, and if the default user profile is
846 not found, then the client will search for a default profile in the NETLOGON share of the authenticating
847 server. In MS Windows parlance,<?latex \linebreak ?><filename>%LOGONSERVER%\NETLOGON\Default User,</filename> and if one
848 exists there it will copy this to the workstation to the <filename>C:\Documents and Settings\</filename>
849 under the Windows login name of the user. </para>
851 <note> <para> This path translates, in Samba parlance, to the &smb.conf;
852 <smbconfsection>[NETLOGON]</smbconfsection> share. The directory should be created at the root
853 of this share and must be called <filename>Default Profile</filename>. </para> </note>
855 <para> If a default profile does not exist in this location, then MS Windows 200x/XP will use the local
856 default profile. </para>
858 <para> On logging out, the users' desktop profile will be stored to the location specified in the registry
859 settings that pertain to the user. If no specific policies have been created or passed to the client
860 during the login process (as Samba does automatically), then the user's profile will be written to the
861 local machine only under the path <filename>C:\Documents and Settings\%USERNAME%</filename>. </para>
863 <para> Those wishing to modify the default behavior can do so through these three methods: </para>
866 <listitem> <para> Modify the registry keys on the local machine manually and place the new
867 default profile in the NETLOGON share root. This is not recommended as it is maintenance intensive.
870 <listitem> <para> Create an NT4-style NTConfig.POL file that specified this behavior and locate
871 this file in the root of the NETLOGON share along with the new default profile. </para> </listitem>
873 <listitem> <para> Create a GPO that enforces this through Active Directory, and place the new
874 default profile in the NETLOGON share. </para> </listitem>
877 <para>The registry hive key that effects the behavior of folders that are part of the default user
878 profile are controlled by entries on Windows 200x/XP is: </para>
880 <para> <filename>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell
881 Folders\</filename> </para>
884 The above hive key contains a list of automatically managed folders. The default entries are shown
885 in <link linkend="defregpthkeys">the next table</link>
886 <indexterm><primary>windows registry settings</primary><secondary>default profile locations</secondary></indexterm>
890 <table frame="all" id="defregpthkeys">
891 <title>Defaults of Default User Profile Paths Registry Keys</title>
893 <colspec align="left"/>
894 <colspec align="left"/>
896 <row><entry>Name</entry><entry>Default Value</entry></row>
899 <row><entry>AppData</entry><entry>%USERPROFILE%\Application Data</entry></row>
900 <row><entry>Cache</entry><entry>%USERPROFILE%\Local Settings\Temporary Internet Files</entry></row>
901 <row><entry>Cookies</entry><entry>%USERPROFILE%\Cookies</entry></row>
902 <row><entry>Desktop</entry><entry>%USERPROFILE%\Desktop</entry></row>
903 <row><entry>Favorites</entry><entry>%USERPROFILE%\Favorites</entry></row>
904 <row><entry>History</entry><entry>%USERPROFILE%\Local Settings\History</entry></row>
905 <row><entry>Local AppData</entry><entry>%USERPROFILE%\Local Settings\Application Data</entry></row>
906 <row><entry>Local Settings</entry><entry>%USERPROFILE%\Local Settings</entry></row>
907 <row><entry>My Pictures</entry><entry>%USERPROFILE%\My Documents\My Pictures</entry></row>
908 <row><entry>NetHood</entry><entry>%USERPROFILE%\NetHood</entry></row>
909 <row><entry>Personal</entry><entry>%USERPROFILE%\My Documents</entry></row>
910 <row><entry>PrintHood</entry><entry>%USERPROFILE%\PrintHood</entry></row>
911 <row><entry>Programs</entry><entry>%USERPROFILE%\Start Menu\Programs</entry></row>
912 <row><entry>Recent</entry><entry>%USERPROFILE%\Recent</entry></row>
913 <row><entry>SendTo</entry><entry>%USERPROFILE%\SendTo</entry></row>
914 <row><entry>Start Menu</entry><entry>%USERPROFILE%\Start Menu</entry></row>
915 <row><entry>Startup</entry><entry>%USERPROFILE%\Start Menu\Programs\Startup</entry></row>
916 <row><entry>Templates</entry><entry>%USERPROFILE%\Templates</entry></row>
921 <para> There is also an entry called <quote>Default</quote> that has no value set. The default entry is
922 of type <constant>REG_SZ</constant>, all the others are of type <constant>REG_EXPAND_SZ</constant>. </para>
924 <para> It makes a huge difference to the speed of handling roaming user profiles if all the folders are
925 stored on a dedicated location on a network server. This means that it will not be necessary to write
926 the Outlook PST file over the network for every login and logout. </para>
928 <para> To set this to a network location, you could use the following examples: </para>
930 <para><filename>%LOGONSERVER%\%USERNAME%\Default Folders</filename></para>
932 <para> This would store the folders in the user's home directory under a directory called <filename>Default
933 Folders</filename>. You could also use: </para>
935 <para><filename>\\<replaceable>SambaServer</replaceable>\<replaceable>FolderShare</replaceable>\%USERNAME%</filename></para>
938 in which case the default folders will be stored in the server named <replaceable>SambaServer</replaceable>
939 in the share called <replaceable>FolderShare</replaceable> under a directory that has the name of the
940 MS Windows user as seen by the Linux/UNIX file system. </para>
942 <para> Please note that once you have created a default profile share, you MUST migrate a user's profile
943 (default or custom) to it. </para>
945 <para> MS Windows 200x/XP profiles may be <emphasis>Local</emphasis> or <emphasis>Roaming</emphasis>.
946 A roaming profile will be cached locally unless the following registry key is created:
948 <indexterm><primary>delete roaming profiles</primary></indexterm>
952 <para> <programlisting> HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\Windows NT\CurrentVersion\
953 winlogon\"DeleteRoamingCache"=dword:00000001</programlisting></para>
956 In this case, the local cache copy will be deleted on logout.
961 <sect1> <title>Common Errors</title>
964 The following are some typical errors, problems and questions that have been asked on the Samba mailing lists.
968 <title>Configuring Roaming Profiles for a Few Users or Groups</title>
971 With Samba-2.2.x, the choice you have is to enable or disable roaming profiles support. It is a
972 global only setting. The default is to have roaming profiles and the default path will locate them in
973 the user's home directory.
977 If disabled globally, then no one will have roaming profile ability. If enabled and you want it
978 to apply only to certain machines, then on those machines on which roaming profile support is not wanted
979 it is then necessary to disable roaming profile handling in the registry of each such machine.
983 With Samba-3, you can have a global profile setting in &smb.conf; and you can override this by
984 per-user settings using the Domain User Manager (as with MS Windows NT4/ Win 200xx). </para>
986 <para> In any case, you can configure only one profile per user. That profile can be either: </para>
989 <listitem>A profile unique to that user.</listitem>
990 <listitem>A mandatory profile (one the user cannot change).</listitem>
991 <listitem>A group profile (really should be mandatory, that is unchangable).</listitem>
996 <sect2> <title>Cannot Use Roaming Profiles</title>
998 <para> A user requested the following: <quote> I do not want Roaming profiles to be implemented. I want
999 to give users a local profile alone. Please help me, I am totally lost with this error. For the past
1000 two days I tried everything, I googled around but found no useful pointers. Please help me. </quote></para>
1002 <para> The choices are: </para>
1006 <term>Local profiles</term> <listitem><para> I know of no registry keys that will allow
1007 auto-deletion of LOCAL profiles on log out.</para></listitem>
1011 <term>Roaming profiles</term> <listitem><para> As a user logs onto the network, a centrally
1012 stored profile is copied to the workstation to form a local profile. This local profile
1013 will persist (remain on the workstation disk) unless a registry key is changed that will
1014 cause this profile to be automatically deleted on logout. </para></listitem>
1018 <para>The roaming profile choices are: </para>
1022 <term>Personal roaming profiles</term> <listitem><para> These are typically stored in
1023 a profile share on a central (or conveniently located local) server. </para>
1025 <para> Workstations cache (store) a local copy of the profile. This cached
1026 copy is used when the profile cannot be downloaded at next logon. </para></listitem>
1030 <term>Group profiles</term> <listitem><para>These are loaded from a central profile
1031 server.</para></listitem>
1035 <term>Mandatory profiles</term> <listitem><para> Mandatory profiles can be created for
1036 a user as well as for any group that a user is a member of. Mandatory profiles cannot be
1037 changed by ordinary users. Only the administrator can change or reconfigure a mandatory
1038 profile. </para></listitem>
1042 <para> A Windows NT4/200x/XP profile can vary in size from 130KB to very large. Outlook PST files are
1043 most often part of the profile and can be many GB in size. On average (in a well controlled environment),
1044 roaming profile size of 2MB is a good rule of thumb to use for planning purposes. In an undisciplined
1045 environment, I have seen up to 2GB profiles. Users tend to complain when it takes an hour to log onto a
1046 workstation but they harvest the fruits of folly (and ignorance). </para>
1048 <para> The point of all the above is to show that roaming profiles and good controls of how they can be
1049 changed as well as good discipline make up for a problem-free site. </para>
1051 <para> Microsoft's answer to the PST problem is to store all email in an MS Exchange Server backend. This
1052 removes the need for a PST file. </para>
1054 <para>Local profiles mean: </para>
1057 <listitem><para>If each machine is used by many users, then much local disk storage is needed
1058 for local profiles.</para></listitem> <listitem><para>Every workstation the user logs into has
1059 its own profile; these can be very different from machine to machine.</para></listitem>
1062 <para> On the other hand, use of roaming profiles means: </para>
1065 <listitem><para>The network administrator can control the desktop environment of all users.</para></listitem>
1066 <listitem><para>Use of mandatory profiles drastically reduces network management overheads.</para></listitem>
1067 <listitem><para>In the long run, users will experience fewer problems.</para></listitem>
1073 <title>Changing the Default Profile</title>
1075 <para><quote>When the client logs onto the Domain Controller, it searches
1076 for a profile to download. Where do I put this default profile?</quote></para>
1079 <indexterm><primary>default profile</primary></indexterm>
1080 First, the Samba server needs to be configured as a Domain Controller. This can be done by
1081 setting in &smb.conf;: </para>
1084 <smbconfoption><name>security</name><value>user</value></smbconfoption>
1085 <smbconfoption><name>os level</name><value>32 (or more)</value></smbconfoption>
1086 <smbconfoption><name>domain logons</name><value>Yes</value></smbconfoption>
1089 <para> There must be a <smbconfsection>[netlogon]</smbconfsection> share that is world readable. It is
1090 a good idea to add a logon script to pre-set printer and drive connections. There is also a facility
1091 for automatically synchronizing the workstation time clock with that of the logon server (another good
1092 thing to do). </para>
1094 <note><para> To invoke auto-deletion of roaming profile from the local workstation cache (disk storage), use
1095 the <application>Group Policy Editor</application> to create a file called <filename>NTConfig.POL</filename>
1096 with the appropriate entries. This file needs to be located in the <smbconfsection>netlogon</smbconfsection>
1097 share root directory.</para></note>
1099 <para> Windows clients need to be members of the domain. Workgroup machines do not use network logons
1100 so they do not interoperate with domain profiles. </para>
1102 <para> For roaming profiles, add to &smb.conf;: </para>
1105 <smbconfoption><name>logon path</name><value>\\%N\profiles\%U</value></smbconfoption>
1106 <smbconfcomment>Default logon drive is Z:</smbconfcomment>
1107 <smbconfoption><name>logon drive</name><value>H:</value></smbconfoption>
1108 <smbconfcomment>This requires a PROFILES share that is world writable.</smbconfcomment>