Docbook XML conversion: projdoc
[Samba/bb.git] / docs / docbook / projdoc / ProfileMgmt.xml
blob82897808b2cd86a747804886342b0b6662c8da3f
1 <chapter id="ProfileMgmt">
2 <chapterinfo>
3         &author.jht;
4     <pubdate>April 3 2003</pubdate>
5 </chapterinfo>
7 <title>Desktop Profile Management</title>
9 <sect1>
10 <title>Roaming Profiles</title>
12 <warning>
13 <para>
14 Roaming profiles support is different for Win9x / Me and Windows NT4/200x.
15 </para>
16 </warning>
18 <para>
19 Before discussing how to configure roaming profiles, it is useful to see how
20 Windows 9x / Me and Windows NT4/200x clients implement these features.
21 </para>
23 <para>
24 Windows 9x / Me clients send a NetUserGetInfo request to the server to get the user's
25 profiles location. However, the response does not have room for a separate
26 profiles location field, only the user's home share. This means that Win9X/Me
27 profiles are restricted to being stored in the user's home directory.
28 </para>
31 <para>
32 Windows NT4/200x  clients send a NetSAMLogon RPC request, which contains many fields,
33 including a separate field for the location of the user's profiles.
34 </para>
36 <sect2>
37 <title>Samba Configuration for Profile Handling</title>
39 <para>
40 This section documents how to configure Samba for MS Windows client profile support.
41 </para>
43 <sect3>
44 <title>NT4/200x User Profiles</title>
46 <para>
47 To support Windowns NT4/200x clients, in the [global] section of smb.conf set the
48 following (for example):
49 </para>
51 <para>
52 <programlisting>
53         logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath
54 </programlisting>
56         This is typically implemented like:
58 <programlisting>
59                 logon path = \\%L\Profiles\%u
60 </programlisting>
61 where %L translates to the name of the Samba server and %u translates to the user name
62 </para>
64 <para>
65 The default for this option is \\%N\%U\profile, namely \\sambaserver\username\profile. 
66 The \\N%\%U service is created automatically by the [homes] service.  If you are using
67 a samba server for the profiles, you _must_ make the share specified in the logon path
68 browseable. Please refer to the man page for smb.conf in respect of the different
69 symantics of %L and %N, as well as %U and %u.
70 </para>
72 <note>
73 <para>
74 MS Windows NT/2K clients at times do not disconnect a connection to a server
75 between logons. It is recommended to NOT use the <command>homes</command>
76 meta-service name as part of the profile share path.
77 </para>
78 </note>
79 </sect3>
81 <sect3>
82 <title>Windows 9x / Me User Profiles</title>
84 <para>
85 To support Windows 9x / Me clients, you must use the "logon home" parameter. Samba has
86 now been fixed so that <userinput>net use /home</userinput> now works as well, and it, too, relies
87 on the <command>logon home</command> parameter.
88 </para>
90 <para>
91 By using the logon home parameter, you are restricted to putting Win9x / Me
92 profiles in the user's home directory.   But wait! There is a trick you
93 can use. If you set the following in the <command>[global]</command> section of your &smb.conf; file:
94 </para>
95 <para><programlisting>
96         logon home = \\%L\%U\.profiles
97 </programlisting></para>
99 <para>
100 then your Windows 9x / Me clients will dutifully put their clients in a subdirectory
101 of your home directory called <filename>.profiles</filename> (thus making them hidden).
102 </para>
104 <para>
105 Not only that, but <userinput>net use /home</userinput> will also work, because of a feature in
106 Windows 9x / Me. It removes any directory stuff off the end of the home directory area
107 and only uses the server and share portion. That is, it looks like you
108 specified \\%L\%U for <command>logon home</command>.
109 </para>
110 </sect3>
112 <sect3>
113 <title>Mixed Windows 9x / Me and Windows NT4/200x User Profiles</title>
115 <para>
116 You can support profiles for both Win9X and WinNT clients by setting both the
117 <command>logon home</command> and <command>logon path</command> parameters. For example:
118 </para>
120 <para><programlisting>
121         logon home = \\%L\%u\.profiles
122         logon path = \\%L\profiles\%u
123 </programlisting></para>
125 </sect3>
126 <sect3>
127 <title>Disabling Roaming Profile Support</title>
129 <para>
130 A question often asked is "How may I enforce use of local profiles?" or
131 "How do I disable Roaming Profiles?"
132 </para>
134 <para>
135 There are three ways of doing this:
136 </para>
138 <itemizedlist>
139         <listitem><para>
140         <command>In smb.conf:</command> affect the following settings and ALL clients
141         will be forced to use a local profile:
142         <programlisting>
143                 logon home =
144                 logon path =
145         </programlisting></para></listitem>
147         <listitem><para>
148         <command>MS Windows Registry:</command> by using the Microsoft Management Console
149         gpedit.msc to instruct your MS Windows XP machine to use only a local profile. This
150         of course modifies registry settings. The full path to the option is:
151         <programlisting>
152         Local Computer Policy\
153                 Computer Configuration\
154                         Administrative Templates\
155                                 System\
156                                         User Profiles\
158         Disable:        Only Allow Local User Profiles
159         Disable:        Prevent Roaming Profile Change from Propogating to the Server
160         </programlisting>
161         </para>
162         </listitem>
164         <listitem><para>
165         <command>Change of Profile Type:</command> From the start menu right click on the
166         MY Computer icon, select <emphasis>Properties</emphasis>, click on the "<emphasis>User Profiles</emphasis>
167         tab, select the profile you wish to change from Roaming type to Local, click <emphasis>Change Type</emphasis>.
168         </para></listitem>
169 </itemizedlist>
171 <para>
172 Consult the MS Windows registry guide for your particular MS Windows version for more
173 information about which registry keys to change to enforce use of only local user
174 profiles.
175 </para>
177 <note><para>
178 The specifics of how to convert a local profile to a roaming profile, or a roaming profile
179 to a local one vary according to the version of MS Windows you are running. Consult the
180 Microsoft MS Windows Resource Kit for your version of Windows for specific information.
181 </para></note>
183 </sect3>
184 </sect2>
186 <sect2>
187 <title>Windows Client Profile Configuration Information</title>
189 <sect3>
190 <title>Windows 9x / Me Profile Setup</title>
192 <para>
193 When a user first logs in on Windows 9X, the file user.DAT is created,
194 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".
195 These directories and their contents will be merged with the local
196 versions stored in c:\windows\profiles\username on subsequent logins,
197 taking the most recent from each.  You will need to use the [global]
198 options "preserve case = yes", "short preserve case = yes" and
199 "case sensitive = no" in order to maintain capital letters in shortcuts
200 in any of the profile folders.
201 </para>
203 <para>
204 The user.DAT file contains all the user's preferences.  If you wish to
205 enforce a set of preferences, rename their user.DAT file to user.MAN,
206 and deny them write access to this file.
207 </para>
209 <orderedlist>
210         <listitem>
211         <para>
212         On the Windows 9x / Me machine, go to Control Panel -> Passwords and
213         select the User Profiles tab.  Select the required level of
214         roaming preferences.  Press OK, but do _not_ allow the computer
215         to reboot.
216         </para>
217         </listitem>
219         <listitem>
220         <para>
221         On the Windows 9x / Me machine, go to Control Panel -> Network ->
222         Client for Microsoft Networks -> Preferences.  Select 'Log on to
223         NT Domain'.  Then, ensure that the Primary Logon is 'Client for
224         Microsoft Networks'.  Press OK, and this time allow the computer
225         to reboot.
226         </para>
227         </listitem>
228 </orderedlist>
230 <para>
231 Under Windows 9x / Me Profiles are downloaded from the Primary Logon.
232 If you have the Primary Logon as 'Client for Novell Networks', then
233 the profiles and logon script will be downloaded from your Novell
234 Server.  If you have the Primary Logon as 'Windows Logon', then the
235 profiles will be loaded from the local machine - a bit against the
236 concept of roaming profiles, it would seem!
237 </para>
239 <para>
240 You will now find that the Microsoft Networks Login box contains
241 [user, password, domain] instead of just [user, password].  Type in
242 the samba server's domain name (or any other domain known to exist,
243 but bear in mind that the user will be authenticated against this
244 domain and profiles downloaded from it, if that domain logon server
245 supports it), user name and user's password.
246 </para>
248 <para>
249 Once the user has been successfully validated, the Windows 9x / Me machine
250 will inform you that 'The user has not logged on before' and asks you
251 if you wish to save the user's preferences?  Select 'yes'.
252 </para>
254 <para>
255 Once the Windows 9x / Me client comes up with the desktop, you should be able
256 to examine the contents of the directory specified in the "logon path"
257 on the samba server and verify that the "Desktop", "Start Menu",
258 "Programs" and "Nethood" folders have been created.
259 </para>
261 <para>
262 These folders will be cached locally on the client, and updated when
263 the user logs off (if you haven't made them read-only by then).
264 You will find that if the user creates further folders or short-cuts,
265 that the client will merge the profile contents downloaded with the
266 contents of the profile directory already on the local client, taking
267 the newest folders and short-cuts from each set.
268 </para>
270 <para>
271 If you have made the folders / files read-only on the samba server,
272 then you will get errors from the Windows 9x / Me machine on logon and logout, as
273 it attempts to merge the local and the remote profile.  Basically, if
274 you have any errors reported by the Windows 9x / Me machine, check the Unix file
275 permissions and ownership rights on the profile directory contents,
276 on the samba server.
277 </para>
279 <para>
280 If you have problems creating user profiles, you can reset the user's
281 local desktop cache, as shown below.  When this user then next logs in,
282 they will be told that they are logging in "for the first time".
283 </para>
285 <orderedlist>
286         <listitem>
287         <para>
288         instead of logging in under the [user, password, domain] dialog,
289         press escape.
290         </para>
291         </listitem>
293         <listitem>
294         <para>
295         run the regedit.exe program, and look in:
296         </para>
298         <para>
299         HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
300         </para>
302         <para>
303         you will find an entry, for each user, of ProfilePath.  Note the
304         contents of this key (likely to be c:\windows\profiles\username),
305         then delete the key ProfilePath for the required user.
307         [Exit the registry editor].
309         </para>
310         </listitem>
312         <listitem>
313         <para>
314         <emphasis>WARNING</emphasis> - before deleting the contents of the
315         directory listed in the ProfilePath (this is likely to be
316         <filename>c:\windows\profiles\username)</filename>, ask them if they
317         have any important files stored on their desktop or in their start menu. 
318         Delete the contents of the directory ProfilePath (making a backup if any
319         of the files are needed).
320         </para>
322         <para>
323         This will have the effect of removing the local (read-only hidden
324         system file) user.DAT in their profile directory, as well as the
325         local "desktop", "nethood", "start menu" and "programs" folders.
326         </para>
327         </listitem>
329         <listitem>
330         <para>
331         search for the user's .PWL password-caching file in the c:\windows
332         directory, and delete it.
333         </para>
334         </listitem>
336         <listitem>
337         <para>
338         log off the windows 9x / Me client.
339         </para>
340         </listitem>
342         <listitem>
343         <para>
344         check the contents of the profile path (see "logon path" described
345         above), and delete the user.DAT or user.MAN file for the user,
346         making a backup if required.
347         </para>
348         </listitem>
350 </orderedlist>
352 <para>
353 If all else fails, increase samba's debug log levels to between 3 and 10,
354 and / or run a packet trace program such as ethereal or netmon.exe, and
355 look for error messages.
356 </para>
358 <para>
359 If you have access to an Windows NT4/200x server, then first set up roaming profiles
360 and / or netlogons on the Windows NT4/200x server.  Make a packet trace, or examine
361 the example packet traces provided with Windows NT4/200x server, and see what the
362 differences are with the equivalent samba trace.
363 </para>
365 </sect3>
367 <sect3>
368 <title>Windows NT4 Workstation</title>
370 <para>
371 When a user first logs in to a Windows NT Workstation, the profile
372 NTuser.DAT is created.  The profile location can be now specified
373 through the "logon path" parameter.
374 </para>
376 <para>
377 There is a parameter that is now available for use with NT Profiles:
378 "logon drive".  This should be set to <filename>H:</filename> or any other drive, and
379 should be used in conjunction with the new "logon home" parameter.
380 </para>
382 <para>
383 The entry for the NT4 profile is a _directory_ not a file.  The NT
384 help on profiles mentions that a directory is also created with a .PDS
385 extension.  The user, while logging in, must have write permission to
386 create the full profile path (and the folder with the .PDS extension
387 for those situations where it might be created.)
388 </para>
390 <para>
391 In the profile directory, Windows NT4 creates more folders than Windows 9x / Me. 
392 It creates "Application Data" and others, as well as "Desktop", "Nethood",
393 "Start Menu" and "Programs".  The profile itself is stored in a file
394 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
395 its purpose is currently unknown.
396 </para>
398 <para>
399 You can use the System Control Panel to copy a local profile onto
400 a samba server (see NT Help on profiles: it is also capable of firing
401 up the correct location in the System Control Panel for you).  The
402 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
403 turns a profile into a mandatory one.
404 </para>
406 <para>
407 The case of the profile is significant.  The file must be called
408 NTuser.DAT or, for a mandatory profile, NTuser.MAN.
409 </para>
410 </sect3>
412 <sect3>
413 <title>Windows 2000/XP Professional</title>
415 <para>
416 You must first convert the profile from a local profile to a domain
417 profile on the MS Windows workstation as follows:
418 </para>
420 <itemizedlist>
421         <listitem><para>
422         Log on as the LOCAL workstation administrator.
423         </para></listitem>
425         <listitem><para>
426         Right click on the 'My Computer' Icon, select 'Properties'
427         </para></listitem>
429         <listitem><para>
430         Click on the 'User Profiles' tab
431         </para></listitem>
433         <listitem><para>
434         Select the profile you wish to convert (click on it once)
435         </para></listitem>
437         <listitem><para>
438         Click on the button 'Copy To'
439         </para></listitem>
441         <listitem><para>
442         In the "Permitted to use" box, click on the 'Change' button.
443         </para></listitem>
445         <listitem><para>
446         Click on the 'Look in" area that lists the machine name, when you click
447         here it will open up a selection box. Click on the domain to which the
448         profile must be accessible.
449         </para>
451         <note><para>You will need to log on if a logon box opens up. Eg: In the connect
452         as: MIDEARTH\root, password: mypassword.</para></note>
453         </listitem>
455         <listitem><para>
456         To make the profile capable of being used by anyone select 'Everyone'
457         </para></listitem>
459         <listitem><para>
460         Click OK. The Selection box will close.
461         </para></listitem>
463         <listitem><para>
464         Now click on the 'Ok' button to create the profile in the path you
465         nominated.
466         </para></listitem>
467 </itemizedlist>
469 <para>
470 Done. You now have a profile that can be editted using the samba-3.0.0
471 <filename>profiles</filename> tool.
472 </para>
474 <note>
475 <para>
476 Under NT/2K the use of mandotory profiles forces the use of MS Exchange
477 storage of mail data. That keeps desktop profiles usable.
478 </para>
479 </note>
481 <note>
482 <itemizedlist>
483 <listitem><para>
484 This is a security check new to Windows XP (or maybe only
485 Windows XP service pack 1).  It can be disabled via a group policy in
486 Active Directory.  The policy is:</para>
488 <para>"Computer Configuration\Administrative Templates\System\User
489 Profiles\Do not check for user ownership of Roaming Profile Folders"</para>
491 <para>...and it should be set to "Enabled".
492 Does the new version of samba have an Active Directory analogue?  If so,
493 then you may be able to set the policy through this.
494 </para>
496 <para>
497 If you cannot set group policies in samba, then you may be able to set
498 the policy locally on each machine.  If you want to try this, then do
499 the following (N.B. I don't know for sure that this will work in the
500 same way as a domain group policy):
501 </para>
503 </listitem>
505 <listitem><para>
506 On the XP workstation log in with an Administrator account.
507 </para></listitem>
509         <listitem><para>Click: "Start", "Run"</para></listitem>
510         <listitem><para>Type: "mmc"</para></listitem>
511         <listitem><para>Click: "OK"</para></listitem>
513         <listitem><para>A Microsoft Management Console should appear.</para></listitem>
514         <listitem><para>Click: File, "Add/Remove Snap-in...", "Add"</para></listitem>
515         <listitem><para>Double-Click: "Group Policy"</para></listitem>
516         <listitem><para>Click: "Finish", "Close"</para></listitem>
517         <listitem><para>Click: "OK"</para></listitem>
519         <listitem><para>In the "Console Root" window:</para></listitem>
520         <listitem><para>Expand: "Local Computer Policy", "Computer Configuration",</para></listitem>
521         <listitem><para>"Administrative Templates", "System", "User Profiles"</para></listitem>
522         <listitem><para>Double-Click: "Do not check for user ownership of Roaming Profile</para></listitem>
523         <listitem><para>Folders"</para></listitem>
524         <listitem><para>Select: "Enabled"</para></listitem>
525         <listitem><para>Click: OK"</para></listitem>
527         <listitem><para>Close the whole console.  You do not need to save the settings (this
528         refers to the console settings rather than the policies you have
529         changed).</para></listitem>
531         <listitem><para>Reboot</para></listitem>
532 </itemizedlist>
533 </note>
534 </sect3>
535 </sect2>
537 <sect2>
538 <title>Sharing Profiles between W9x/Me and NT4/200x/XP workstations</title>
540 <para>
541 Sharing of desktop profiles between Windows versions is NOT recommended.
542 Desktop profiles are an evolving phenomenon and profiles for later versions
543 of MS Windows clients add features that may interfere with earlier versions
544 of MS Windows clients. Probably the more salient reason to NOT mix profiles
545 is that when logging off an earlier version of MS Windows the older format
546 of profile contents may overwrite information that belongs to the newer
547 version resulting in loss of profile information content when that user logs
548 on again with the newer version of MS Windows.
549 </para>
551 <para>
552 If you then want to share the same Start Menu / Desktop with W9x/Me, you will
553 need to specify a common location for the profiles. The smb.conf parameters
554 that need to be common are <emphasis>logon path</emphasis> and
555 <emphasis>logon home</emphasis>.
556 </para>
558 <para>
559 If you have this set up correctly, you will find separate user.DAT and
560 NTuser.DAT files in the same profile directory.
561 </para>
563 </sect2>
565 <sect2>
566 <title>Profile Migration from Windows NT4/200x Server to Samba</title>
568 <para>
569 There is nothing to stop you specifying any path that you like for the
570 location of users' profiles.  Therefore, you could specify that the
571 profile be stored on a samba server, or any other SMB server, as long as
572 that SMB server supports encrypted passwords.
573 </para>
575 <sect3>
576 <title>Windows NT4 Profile Management Tools</title>
578 <para>
579 Unfortunately, the Resource Kit information is specific to the version of MS Windows
580 NT4/200x. The correct resource kit is required for each platform.
581 </para>
583 <para>
584 Here is a quick guide:
585 </para>
587 <itemizedlist>
589 <listitem><para>
590 On your NT4 Domain Controller, right click on 'My Computer', then
591 select the tab labelled 'User Profiles'.
592 </para></listitem>
594 <listitem><para>
595 Select a user profile you want to migrate and click on it.
596 </para>
598 <note><para>I am using the term &quot;migrate&quot; lossely. You can copy a profile to
599 create a group profile. You can give the user 'Everyone' rights to the
600 profile you copy this to. That is what you need to do, since your samba
601 domain is not a member of a trust relationship with your NT4 PDC.</para></note>
602 </listitem>
604         <listitem><para>Click the 'Copy To' button.</para></listitem>
606         <listitem><para>In the box labelled 'Copy Profile to' add your new path, eg:
607         <filename>c:\temp\foobar</filename></para></listitem>
609         <listitem><para>Click on the button labelled 'Change' in the "Permitted to use" box.</para></listitem>
611         <listitem><para>Click on the group 'Everyone' and then click OK. This closes the
612         'chose user' box.</para></listitem>
614         <listitem><para>Now click OK.</para></listitem>
615 </itemizedlist>
617 <para>
618 Follow the above for every profile you need to migrate.
619 </para>
621 </sect3>
623 <sect3>
624 <title>Side bar Notes</title>
626 <para>
627 You should obtain the SID of your NT4 domain. You can use smbpasswd to do
628 this. Read the man page.</para>
630 <para>
631 With Samba-3.0.0 alpha code you can import all you NT4 domain accounts
632 using the net samsync method. This way you can retain your profile
633 settings as well as all your users.
634 </para>
636 </sect3>
638 <sect3>
639 <title>moveuser.exe</title>
641 <para>
642 The W2K professional resource kit has moveuser.exe. moveuser.exe changes
643 the security of a profile from one user to another.  This allows the account
644 domain to change, and/or the user name to change.
645 </para>
647 </sect3>
649 <sect3>
650 <title>Get SID</title>
652 <para>
653 You can identify the SID by using GetSID.exe from the Windows NT Server 4.0
654 Resource Kit.
655 </para>
657 <para>
658 Windows NT 4.0 stores the local profile information in the registry under
659 the following key:
660 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
661 </para>
663 <para>
664 Under the ProfileList key, there will be subkeys named with the SIDs of the
665 users who have logged on to this computer. (To find the profile information
666 for the user whose locally cached profile you want to move, find the SID for
667 the user with the GetSID.exe utility.) Inside of the appropriate user's
668 subkey, you will see a string value named ProfileImagePath.
669 </para>
671 </sect3>
672 </sect2>
673 </sect1>
675 <sect1>
676 <title>Mandatory profiles</title>
678 <para>
679 A Mandatory Profile is a profile that the user does NOT have the ability to overwrite.
680 During the user's session it may be possible to change the desktop environment, but
681 as the user logs out all changes made will be lost. If it is desired to NOT allow the
682 user any ability to change the desktop environment then this must be done through
683 policy settings. See previous chapter.
684 </para>
686 <note>
687 <para>
688 Under NO circumstances should the profile directory (or it's contents) be made read-only
689 as this may render the profile un-usable.
690 </para>
691 </note>
693 <para>
694 For MS Windows NT4/200x/XP the above method can be used to create mandatory profiles
695 also. To convert a group profile into a mandatory profile simply locate the NTUser.DAT
696 file in the copied profile and rename it to NTUser.MAN.
697 </para>
699 <para>
700 For MS Windows 9x / Me it is the User.DAT file that must be renamed to User.MAN to
701 affect a mandatory profile.
702 </para>
704 </sect1>
706 <sect1>
707 <title>Creating/Managing Group Profiles</title>
709 <para>
710 Most organisations are arranged into departments. There is a nice benenfit in
711 this fact since usually most users in a department will require the same desktop
712 applications and the same desktop layout. MS Windows NT4/200x/XP will allow the
713 use of Group Profiles. A Group Profile is a profile that is created firstly using
714 a template (example) user. Then using the profile migration tool (see above) the
715 profile is assigned access rights for the user group that needs to be given access
716 to the group profile.
717 </para>
719 <para>
720 The next step is rather important. PLEASE NOTE: Instead of assigning a group profile
721 to users (ie: Using User Manager) on a "per user" basis, the group itself is assigned
722 the now modified profile.
723 </para>
725 <note>
726         <para>
727         Be careful with group profiles, if the user who is a member of a group also
728         has a personal profile, then the result will be a fusion (merge) of the two.
729         </para>
730 </note>
732 </sect1>
734 <sect1>
735 <title>Default Profile for Windows Users</title>
737 <para>
738 MS Windows 9x / Me and NT4/200x/XP will use a default profile for any user for whom
739 a profile does not already exist. Armed with a knowledge of where the default profile
740 is located on the Windows workstation, and knowing which registry keys affect the path
741 from which the default profile is created, it is possible to modify the default profile
742 to one that has been optimised for the site. This has significant administrative 
743 advantages.
744 </para>
746 <sect2>
747 <title>MS Windows 9x/Me</title>
749 <para>
750 To enable default per use profiles in Windows 9x / Me you can either use the Windows 98 System
751 Policy Editor or change the registry directly.
752 </para>
754 <para>
755 To enable default per user profiles in Windows 9x / Me, launch the System Policy Editor, then
756 select File -> Open Registry, then click on the Local Computer icon, click on Windows 98 System,
757 select User Profiles, click on the enable box. Do not forget to save the registry changes.
758 </para>
760 <para>
761 To modify the registry directly, launch the Registry Editor (regedit.exe), select the hive
762 <filename>HKEY_LOCAL_MACHINE\Network\Logon</filename>. Now add a DWORD type key with the name
763 "User Profiles", to enable user profiles set the value to 1, to disable user profiles set it to 0.
764 </para>
766 <sect3>
767 <title>How User Profiles Are Handled in Windows 9x / Me?</title>
769 <para>
770 When a user logs on to a Windows 9x / Me machine, the local profile path, 
771 <filename>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ProfileList</filename>, is checked
772 for an existing entry for that user:
773 </para>
775 <para>
776 If the user has an entry in this registry location, Windows 9x / Me checks for a locally cached
777 version of the user profile. Windows 9x / Me also checks the user's home directory (or other
778 specified directory if the location has been modified) on the server for the User Profile.
779 If a profile exists in both locations, the newer of the two is used. If the User Profile exists
780 on the server, but does not exist on the local machine, the profile on the server is downloaded
781 and used. If the User Profile only exists on the local machine, that copy is used.
782 </para>
784 <para>
785 If a User Profile is not found in either location, the Default User Profile from the Windows 9x / Me
786 machine is used and is copied to a newly created folder for the logged on user. At log off, any
787 changes that the user made are written to the user's local profile. If the user has a roaming
788 profile, the changes are written to the user's profile on the server.
789 </para>
791 </sect3>
792 </sect2>
794 <sect2>
795 <title>MS Windows NT4 Workstation</title>
797 <para>
798 On MS Windows NT4 the default user profile is obtained from the location
799 <filename>%SystemRoot%\Profiles</filename> which in a default installation will translate to
800 <filename>C:\WinNT\Profiles</filename>. Under this directory on a clean install there will be
801 three (3) directories: <filename>Administrator, All Users, Default User</filename>.
802 </para>
804 <para>
805 The <filename>All Users</filename> directory contains menu settings that are common across all 
806 system users. The <filename>Default User</filename> directory contains menu entries that are
807 customisable per user depending on the profile settings chosen/created.
808 </para>
810 <para>
811 When a new user first logs onto an MS Windows NT4 machine a new profile is created from:
812 </para>
814 <simplelist>
815         <member>All Users settings</member>
816         <member>Default User settings (contains the default NTUser.DAT file)</member>
817 </simplelist>
819 <para>
820 When a user logs onto an MS Windows NT4 machine that is a member of a Microsoft security domain
821 the following steps are followed in respect of profile handling:
822 </para>
824 <orderedlist>
825         <listitem>
826         <para>
827         The users' account information which is obtained during the logon process contains
828         the location of the users' desktop profile. The profile path may be local to the
829         machine or it may be located on a network share. If there exists a profile at the location
830         of the path from the user account, then this profile is copied to the location
831         <filename>%SystemRoot%\Profiles\%USERNAME%</filename>. This profile then inherits the
832         settings in the <filename>All Users</filename> profile in the <filename>%SystemRoot%\Profiles</filename>
833         location.
834         </para>
835         </listitem>
837         <listitem>
838         <para>
839         If the user account has a profile path, but at it's location a profile does not exist,
840         then a new profile is created in the <filename>%SystemRoot%\Profiles\%USERNAME%</filename>
841         directory from reading the <filename>Default User</filename> profile.
842         </para>
843         </listitem>
845         <listitem>
846         <para>
847         If the NETLOGON share on the authenticating server (logon server) contains a policy file
848         (<filename>NTConfig.POL</filename>) then it's contents are applied to the <filename>NTUser.DAT</filename>
849         which is applied to the <filename>HKEY_CURRENT_USER</filename> part of the registry. 
850         </para>
851         </listitem>
853         <listitem>
854         <para>
855         When the user logs out, if the profile is set to be a roaming profile it will be written
856         out to the location of the profile. The <filename>NTuser.DAT</filename> file is then
857         re-created from the contents of the <filename>HKEY_CURRENT_USER</filename> contents.
858         Thus, should there not exist in the NETLOGON share an <filename>NTConfig.POL</filename> at the
859         next logon, the effect of the provious <filename>NTConfig.POL</filename> will still be held
860         in the profile. The effect of this is known as <emphasis>tatooing</emphasis>.
861         </para>
862         </listitem>
863 </orderedlist>
865 <para>
866 MS Windows NT4 profiles may be <emphasis>Local</emphasis> or <emphasis>Roaming</emphasis>. A Local profile
867 will stored in the <filename>%SystemRoot%\Profiles\%USERNAME%</filename> location. A roaming profile will
868 also remain stored in the same way, unless the following registry key is created:
869 </para>
871 <para>
872 <programlisting>
873         HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\Windows NT\CurrentVersion\winlogon\
874         "DeleteRoamingCache"=dword:00000001
875 </programlisting>
877 In which case, the local copy (in <filename>%SystemRoot%\Profiles\%USERNAME%</filename>) will be
878 deleted on logout.
879 </para>
881 <para>
882 Under MS Windows NT4 default locations for common resources (like <filename>My Documents</filename>
883 may be redirected to a network share by modifying the following registry keys. These changes may be affected
884 via use of the System Policy Editor (to do so may require that you create your owns template extension
885 for the policy editor to allow this to be done through the GUI. Another way to do this is by way of first
886 creating a default user profile, then while logged in as that user, run regedt32 to edit the key settings.
887 </para>
889 <para>
890 The Registry Hive key that affects the behaviour of folders that are part of the default user profile
891 are controlled by entries on Windows NT4 is:
892 </para>
894 <para>
895 <programlisting>
896         HKEY_CURRENT_USER
897                 \Software
898                         \Microsoft
899                                 \Windows
900                                         \CurrentVersion
901                                                 \Explorer
902                                                         \User Shell Folders\
903 </programlisting>
904 </para>
906 <para>
907 The above hive key contains a list of automatically managed folders. The default entries are:
908 </para>
910         <para>
911         <programlisting>
912         Name            Default Value
913         --------------  -----------------------------------------
914         AppData         %USERPROFILE%\Application Data
915         Desktop         %USERPROFILE%\Desktop
916         Favorites       %USERPROFILE%\Favorites
917         NetHood         %USERPROFILE%\NetHood
918         PrintHood       %USERPROFILE%\PrintHood
919         Programs        %USERPROFILE%\Start Menu\Programs
920         Recent          %USERPROFILE%\Recent
921         SendTo          %USERPROFILE%\SendTo
922         Start Menu      %USERPROFILE%\Start Menu
923         Startup         %USERPROFILE%\Start Menu\Programs\Startup
924         </programlisting>
925         </para>
927 <para>
928 The registry key that contains the location of the default profile settings is:
930 <programlisting>
931         HKEY_LOCAL_MACHINE
932                 \SOFTWARE
933                         \Microsoft
934                                 \Windows
935                                         \CurrentVersion
936                                                 \Explorer
937                                                         \User Shell Folders
938 </programlisting>
940 The default entries are:
942 <programlisting>
943         Common Desktop          %SystemRoot%\Profiles\All Users\Desktop
944         Common Programs         %SystemRoot%\Profiles\All Users\Programs
945         Common Start Menu       %SystemRoot%\Profiles\All Users\Start Menu
946         Common Startup          %SystemRoot%\Profiles\All Users\Start Menu\Progams\Startup
947 </programlisting>
948 </para>
950 </sect2>
952 <sect2>
953 <title>MS Windows 200x/XP</title>
955         <note>
956         <para>
957         MS Windows XP Home Edition does use default per user profiles, but can not participate
958         in domain security, can not log onto an NT/ADS style domain, and thus can obtain the profile
959         only from itself. While there are benefits in doing this the beauty of those MS Windows
960         clients that CAN participate in domain logon processes allows the administrator to create
961         a global default profile and to enforce it through the use of Group Policy Objects (GPOs).
962         </para>
963         </note>
965 <para>
966 When a new user first logs onto MS Windows 200x/XP machine the default profile is obtained from
967 <filename>C:\Documents and Settings\Default User</filename>. The administrator can modify (or change
968 the contents of this location and MS Windows 200x/XP will gladly use it. This is far from the optimum
969 arrangement since it will involve copying a new default profile to every MS Windows 200x/XP client
970 workstation. 
971 </para>
973 <para>
974 When MS Windows 200x/XP participate in a domain security context, and if the default user
975 profile is not found, then the client will search for a default profile in the NETLOGON share
976 of the authenticating server. ie: In MS Windows parlance:
977 <filename>%LOGONSERVER%\NETLOGON\Default User</filename> and if one exits there it will copy this
978 to the workstation to the <filename>C:\Documents and Settings\</filename> under the Windows
979 login name of the user.
980 </para>
982         <note>
983         <para>
984         This path translates, in Samba parlance, to the smb.conf [NETLOGON] share. The directory
985         should be created at the root of this share and must be called <filename>Default Profile</filename>.
986         </para>
987         </note>
989 <para>
990 If a default profile does not exist in this location then MS Windows 200x/XP will use the local
991 default profile.
992 </para>
994 <para>
995 On loging out, the users' desktop profile will be stored to the location specified in the registry
996 settings that pertain to the user. If no specific policies have been created, or passed to the client
997 during the login process (as Samba does automatically), then the user's profile will be written to
998 the local machine only under the path <filename>C:\Documents and Settings\%USERNAME%</filename>.
999 </para>
1001 <para>
1002 Those wishing to modify the default behaviour can do so through three methods:
1003 </para>
1005 <itemizedlist>
1006         <listitem>
1007         <para>
1008         Modify the registry keys on the local machine manually and place the new default profile in the
1009         NETLOGON share root - NOT recommended as it is maintenance intensive.
1010         </para>
1011         </listitem>
1013         <listitem>
1014         <para>
1015         Create an NT4 style NTConfig.POL file that specified this behaviour and locate this file
1016         in the root of the NETLOGON share along with the new default profile.
1017         </para>
1018         </listitem>
1020         <listitem>
1021         <para>
1022         Create a GPO that enforces this through Active Directory, and place the new default profile
1023         in the NETLOGON share.
1024         </para>
1025         </listitem>
1026 </itemizedlist>
1028 <para>
1029 The Registry Hive key that affects the behaviour of folders that are part of the default user profile
1030 are controlled by entries on Windows 200x/XP is:
1031 </para>
1033 <para>
1034 <programlisting>
1035         HKEY_CURRENT_USER
1036                 \Software
1037                         \Microsoft
1038                                 \Windows
1039                                         \CurrentVersion
1040                                                 \Explorer
1041                                                         \User Shell Folders\
1042 </programlisting>
1043 </para>
1045 <para>
1046 The above hive key contains a list of automatically managed folders. The default entries are:
1047 </para>
1049         <para>
1050         <programlisting>
1051         Name            Default Value
1052         --------------  -----------------------------------------
1053         AppData         %USERPROFILE%\Application Data
1054         Cache           %USERPROFILE%\Local Settings\Temporary Internet Files
1055         Cookies         %USERPROFILE%\Cookies
1056         Desktop         %USERPROFILE%\Desktop
1057         Favorites       %USERPROFILE%\Favorites
1058         History         %USERPROFILE%\Local Settings\History
1059         Local AppData   %USERPROFILE%\Local Settings\Application Data
1060         Local Settings  %USERPROFILE%\Local Settings
1061         My Pictures     %USERPROFILE%\My Documents\My Pictures
1062         NetHood         %USERPROFILE%\NetHood
1063         Personal        %USERPROFILE%\My Documents
1064         PrintHood       %USERPROFILE%\PrintHood
1065         Programs        %USERPROFILE%\Start Menu\Programs
1066         Recent          %USERPROFILE%\Recent
1067         SendTo          %USERPROFILE%\SendTo
1068         Start Menu      %USERPROFILE%\Start Menu
1069         Startup         %USERPROFILE%\Start Menu\Programs\Startup
1070         Templates       %USERPROFILE%\Templates
1071         </programlisting>
1072         </para>
1074 <para>
1075 There is also an entry called "Default" that has no value set. The default entry is of type REG_SZ, all
1076 the others are of type REG_EXPAND_SZ.
1077 </para>
1079 <para>
1080 It makes a huge difference to the speed of handling roaming user profiles if all the folders are
1081 stored on a dedicated location on a network server. This means that it will NOT be necessary to
1082 write the Outlook PST file over the network for every login and logout.
1083 </para>
1085 <para>
1086 To set this to a network location you could use the following examples:
1088 <programlisting>
1089         %LOGONSERVER%\%USERNAME%\Default Folders
1090 </programlisting>
1092 This would store the folders in the user's home directory under a directory called "Default Folders"
1094 You could also use:
1096 <programlisting>
1097         \\SambaServer\FolderShare\%USERNAME%
1098 </programlisting>
1100 in which case the default folders will be stored in the server named <emphasis>SambaServer</emphasis>
1101 in the share called <emphasis>FolderShare</emphasis> under a directory that has the name of the MS Windows
1102 user as seen by the Linux/Unix file system.
1103 </para>
1105 <para>
1106 Please note that once you have created a default profile share, you MUST migrate a user's profile
1107 (default or custom) to it.
1108 </para>
1110 <para>
1111 MS Windows 200x/XP profiles may be <emphasis>Local</emphasis> or <emphasis>Roaming</emphasis>.
1112 A roaming profile will be cached locally unless the following registry key is created:
1113 </para>
1115 <para>
1116 <programlisting>
1117         HKEY_LOCAL_MACHINE\SYSTEM\Software\Microsoft\Windows NT\CurrentVersion\winlogon\
1118         "DeleteRoamingCache"=dword:00000001
1119 </programlisting>
1121 In which case, the local cache copy will be deleted on logout.
1122 </para>
1123 </sect2>
1124 </sect1>
1126 </chapter>