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