I'm still working on this. More to come.
[bbaumbach/samba-autobuild/.git] / docs / docbook / projdoc / PolicyMgmt.xml
1 <chapter id="PolicyMgmt">
2 <chapterinfo>
3         &author.jht;
4     <pubdate>April 3 2003</pubdate>
5 </chapterinfo>
6
7 <title>System and Account Policies</title>
8
9 <para>
10 This chapter summarizes the current state of knowledge derived from personal
11 practice and knowledge from Samba mailing list subscribers. Before reproduction
12 of posted information, every effort has been made to validate the information given.
13 Where additional information was uncovered through this validation it is provided
14 also.
15 </para>
16
17 <sect1>
18 <title>Features and Benefits</title>
19
20 <para>
21 When MS Windows NT 3.5 was introduced, the hot new topic was the ability to implement
22 Group Policies for users and groups. Then along came MS Windows NT4 and a few sites
23 started to adopt this capability. How do we know that? By the number of <quote>booboos</quote>
24 (or mistakes) administrators made and then requested help to resolve.
25 </para>
26
27 <para>
28 <indexterm><primary>group policies</primary></indexterm>
29 <indexterm><primary>GPOs</primary></indexterm>
30 <indexterm><primary>group policy objects</primary><see>GPOs</see></indexterm>
31 By the time that MS Windows 2000 and Active Directory was released, administrators
32 got the message: Group Policies are a good thing! They can help reduce administrative
33 costs and actually make happier users. But adoption of the true
34 potential of MS Windows 200x Active Directory and Group Policy Objects (GPOs) for users
35 and machines were picked up on rather slowly. This was obvious from the Samba
36 mailing list as in 2000 and 2001 when there were few postings regarding GPOs and
37 how to replicate them in a Samba environment.
38 </para>
39
40 <para>
41 Judging by the traffic volume since mid 2002, GPOs have become a standard part of
42 the deployment in many sites. This chapter reviews techniques and methods that can
43 be used to exploit opportunities for automation of control over user desktops and
44 network client workstations.
45 </para>
46
47 <para>
48 A tool new to Samba &smbmdash; the <command>editreg</command> tool
49 &smbmdash; may become an important part of the future Samba administrators'
50 arsenal is described in this document.
51 </para>
52
53 </sect1>
54
55 <sect1>
56 <title>Creating and Managing System Policies</title>
57
58 <para>
59 Under MS Windows platforms, particularly those following the release of MS Windows
60 NT4 and MS Windows 95, it is possible to create a type of file that would be placed
61 in the NETLOGON share of a Domain Controller. As the client logs onto the network,
62 this file is read and the contents initiate changes to the registry of the client
63 machine. This file allows changes to be made to those parts of the registry that
64 affect users, groups of users, or machines.
65 </para>
66
67 <para>
68 <indexterm><primary>Config.POL</primary></indexterm>
69 For MS Windows 9x/ME, this file must be called <filename>Config.POL</filename> and may
70 be generated using a tool called <filename>poledit.exe</filename>, better known as the
71 Policy Editor. The policy editor was provided on the Windows 98 installation CD, but
72 disappeared again with the introduction of MS Windows Me (Millennium Edition). From
73 comments of MS Windows network administrators, it would appear that this tool became
74 a part of the MS Windows Me Resource Kit.
75 </para>
76
77 <para>
78 <indexterm><primary>System Policy Editor</primary></indexterm>
79 MS Windows NT4 Server products include the <emphasis>System Policy Editor</emphasis>
80 under <guimenu>Start -> Programs -> Administrative Tools</guimenu>.
81 For MS Windows NT4 and later clients, this file must be called <filename>NTConfig.POL</filename>.
82 </para>
83
84 <para>
85 New with the introduction of MS Windows 2000 was the Microsoft Management Console
86 or MMC. This tool is the new wave in the ever-changing landscape of Microsoft
87 methods for management of network access and security. Every new Microsoft product
88 or technology seems to make the old rules obsolete and introduces newer and more
89 complex tools and methods. To Microsoft's credit, the MMC does appear to
90 be a step forward, but improved functionality comes at a great price.
91 </para>
92
93 <para>
94 Before embarking on the configuration of network and system policies, it is highly
95 advisable to read the documentation available from Microsoft's Web site regarding
96 <ulink url="http://www.microsoft.com/ntserver/management/deployment/planguide/prof_policies.asp">
97 Implementing Profiles and Policies in Windows NT 4.0</ulink> available from Microsoft.
98 There are a large number of documents in addition to this old one that should also
99 be read and understood. Try searching on the Microsoft Web site for <quote>Group Policies</quote>.
100 </para>
101
102 <para>
103 What follows is a brief discussion with some helpful notes. The information provided
104 here is incomplete &smbmdash; you are warned.
105 </para>
106
107         <sect2>
108         <title>Windows 9x/ME Policies</title>
109
110         <para>
111         You need the Windows 98 Group Policy Editor to set up Group Profiles under Windows 9x/ME.
112         It can be found on the original full product Windows 98 installation CD under
113         <filename>tools/reskit/netadmin/poledit</filename>. Install this using the
114         Add/Remove Programs facility and then click on <guiicon>Have Disk</guiicon>.
115         </para>
116
117
118         <para>
119 <indexterm><primary>NTConfig.POL</primary></indexterm>
120         Use the Group Policy Editor to create a policy file that specifies the location of
121         user profiles and/or <filename>My Documents</filename>, and so on. Then save these
122         settings in a file called <filename>Config.POL</filename> that needs to be placed in the
123         root of the <smbconfsection>[NETLOGON]</smbconfsection> share. If Windows 98 is configured to log onto
124         the Samba Domain, it will automatically read this file and update the Windows 9x/Me registry
125         of the machine as it logs on.
126         </para>
127
128         <para>
129         Further details are covered in the Windows 98 Resource Kit documentation.
130         </para>
131
132         <para>
133         If you do not take the correct steps, then every so often Windows 9x/ME will check the
134         integrity of the registry and restore its settings from the back-up
135         copy of the registry it stores on each Windows 9x/ME machine. So, you will
136         occasionally notice things changing back to the original settings.
137         </para>
138
139         <para>
140         Install the group policy handler for Windows 9x/Me to pick up Group Policies. Look on the
141         Windows 98 CDROM in <filename>\tools\reskit\netadmin\poledit</filename>.
142         Install group policies on a Windows 9x/Me client by double-clicking on
143         <filename>grouppol.inf</filename>. Log off and on again a couple of times and see
144         if Windows 98 picks up Group Policies. Unfortunately, this needs to be done on every
145         Windows 9x/Me machine that uses Group Policies.
146         </para>
147
148         </sect2>
149         <sect2>
150         <title>Windows NT4-Style Policy Files</title>
151
152         <para>
153         To create or edit <filename>ntconfig.pol</filename> you must use the NT Server
154         Policy Editor, <command>poledit.exe</command>, which is included with NT4 Server
155         but not with NT Workstation. There is a Policy Editor on an NT4
156         Workstation but it is not suitable for creating domain policies.
157         Furthermore, although the Windows 95 Policy Editor can be installed on an NT4
158         Workstation/Server, it will not work with NT clients. However, the files from
159         the NT Server will run happily enough on an NT4 Workstation.
160         </para>
161
162         <para>
163         You need <filename>poledit.exe</filename>, <filename>common.adm</filename> and <filename>winnt.adm</filename>.
164         It is convenient to put the two <filename>*.adm</filename> files in  the <filename>c:\winnt\inf</filename> 
165         directory, which is where the binary will look for them unless told otherwise. This
166         directory is normally <quote>hidden.</quote>
167         </para>
168
169         <para>
170         The Windows NT policy editor is also included with the Service Pack 3 (and
171         later) for Windows NT 4.0. Extract the files using <command>servicepackname /x</command>,
172         that's <command>Nt4sp6ai.exe /x</command> for service pack 6a. The Policy Editor,
173         <command>poledit.exe</command>, and the associated template files (*.adm) should
174         be extracted as well. It is also possible to downloaded the policy template
175         files for Office97 and get a copy of the Policy Editor. Another possible
176         location is with the Zero Administration Kit available for download from Microsoft.
177         </para>
178
179                 <sect3>
180                 <title>Registry Spoiling</title>
181
182                         <para>
183                         With NT4-style registry-based policy changes, a large number of settings are not
184                         automatically reversed as the user logs off. The settings that were in the
185                         <filename>NTConfig.POL</filename> file were applied to the client machine registry and apply to the
186                         hive key HKEY_LOCAL_MACHINE are permanent until explicitly reversed. This is known
187                         as tattooing. It can have serious consequences downstream and the administrator must
188                         be extremely careful not to lock out the ability to manage the machine at a later date.
189                         </para>
190
191                 </sect3>
192         </sect2>
193         <sect2>
194         <title>MS Windows 200x/XP Professional Policies</title>
195
196         <para>
197         Windows NT4 system policies allow the setting of registry parameters specific to
198         users, groups and computers (client workstations) that are members of the NT4-style
199         domain. Such policy files will work with MS Windows 200x/XP clients also.
200         </para>
201
202         <para>
203         New to MS Windows 2000, Microsoft recently introduced a style of group policy that confers
204         a superset of capabilities compared with NT4-style policies. Obviously, the tool used
205         to create them is different, and the mechanism for implementing them is much improved.
206         </para>
207
208         <para>
209 <indexterm><primary>GPOs</primary></indexterm>
210         The older NT4-style registry-based policies are known as <emphasis>Administrative Templates</emphasis>
211         in MS Windows 2000/XP Group Policy Objects (GPOs). The later includes the ability to set various security
212         configurations, enforce Internet Explorer browser settings, change and redirect aspects of the
213         users desktop (including the location of <filename>My Documents</filename> files (directory), as
214         well as intrinsics of where menu items will appear in the Start menu). An additional new
215         feature is the ability to make available particular software Windows applications to particular
216         users and/or groups.
217         </para>
218
219         <para>
220         Remember, NT4 policy files are named <filename>NTConfig.POL</filename> and are stored in the root
221         of the NETLOGON share on the Domain Controllers. A Windows NT4 user enters a username, password
222         and selects the domain name to which the logon will attempt to take place. During the logon process,
223         the client machine reads the <filename>NTConfig.POL</filename> file from the NETLOGON share on
224         the authenticating server and modifies the local registry values according to the settings in this file.
225         </para>
226
227         <para>
228         Windows 200x GPOs are feature-rich. They are not stored in the NETLOGON share, but rather part of
229         a Windows 200x policy file is stored in the Active Directory itself and the other part is stored
230         in a shared (and replicated) volume called the SYSVOL folder. This folder is present on all Active
231         Directory Domain Controllers. The part that is stored in the Active Directory itself is called the
232         Group Policy Container (GPC), and the part that is stored in the replicated share called SYSVOL is
233         known as the Group Policy Template (GPT).
234         </para>
235
236         <para>
237         With NT4 clients, the policy file is read and executed only as each user logs onto the network.
238         MS Windows 200x policies are much more complex &smbmdash; GPOs are processed and applied at client machine
239         startup (machine specific part) and when the user logs onto the network, the user-specific part
240         is applied. In MS Windows 200x-style policy management, each machine and/or user may be subject
241         to any number of concurrently applicable (and applied) policy sets (GPOs). Active Directory allows
242         the administrator to also set filters over the policy settings. No such equivalent capability
243         exists with NT4-style policy files.
244         </para>
245
246                 <sect3>
247                 <title>Administration of Windows 200x/XP Policies</title>
248
249                 <para>
250 <indexterm><primary>GPOs</primary></indexterm>
251 <indexterm><primary>System Policy Editor</primary></indexterm>
252                 Instead of using the tool called <application>The System Policy Editor</application>, commonly called Poledit (from the
253                 executable name <command>poledit.exe</command>), <acronym>GPOs</acronym> are created and managed using a 
254                 <application>Microsoft Management Console</application> <acronym>(MMC)</acronym> snap-in as follows:</para>
255                 <procedure>
256                         <step><para>
257                         Go to the Windows 200x/XP menu <guimenu>Start->Programs->Administrative Tools</guimenu>
258                         and select the MMC snap-in called <guimenuitem>Active Directory Users and Computers</guimenuitem>
259                         </para></step>
260
261                         <step><para>
262                         Select the domain or organizational unit (OU) that you wish to manage, then right-click
263                         to open the context menu for that object, and select the <guibutton>Properties</guibutton>.
264                         </para></step>
265
266                         <step><para>
267                         Left-click on the <guilabel>Group Policy</guilabel> tab, then
268                         left-click on the New tab. Type a name
269                         for the new policy you will create.
270                         </para></step>
271
272                         <step><para>
273                          Left-click on the <guilabel>Edit</guilabel> tab to commence the steps needed to create the GPO.
274                         </para></step>
275                 </procedure>
276
277                 <para>
278                 All policy configuration options are controlled through the use of policy administrative
279                 templates. These files have an .adm extension, both in NT4 as well as in Windows 200x/XP.
280                 Beware, however, the .adm files are not interchangeable across NT4 and Windows 200x.
281                 The latter introduces many new features as well as extended definition capabilities. It is
282                 well beyond the scope of this documentation to explain how to program .adm files; for that
283                 the administrator is referred to the Microsoft Windows Resource Kit for your particular
284                 version of MS Windows.
285                 </para>
286
287                 <note>
288                 <para>
289                 The MS Windows 2000 Resource Kit contains a tool called gpolmig.exe. This tool can be used
290                 to migrate an NT4 NTConfig.POL file into a Windows 200x style GPO. Be VERY careful how you
291                 use this powerful tool. Please refer to the resource kit manuals for specific usage information.
292                 </para>
293                 </note>
294
295                 </sect3>
296         </sect2>
297 </sect1>
298
299 <sect1>
300 <title>Managing Account/User Policies</title>
301
302 <para>
303 Policies can define a specific user's settings or the settings for a group of users. The resulting
304 policy file contains the registry settings for all users, groups, and computers that will be using
305 the policy file. Separate policy files for each user, group, or computer are not necessary.
306 </para>
307
308 <para>
309 <indexterm><primary>NTConfig.POL</primary></indexterm>
310 If you create a policy that will be automatically downloaded from validating Domain Controllers,
311 you should name the file <filename>NTConfig.POL</filename>. As system administrator, you have the option of renaming the
312 policy file and, by modifying the Windows NT-based workstation, directing the computer to update
313 the policy from a manual path. You can do this by either manually changing the registry or by using
314 the System Policy Editor. This can even be a local path such that each machine has its own policy file,
315 but if a change is necessary to all machines, it must be made individually to each workstation.
316 </para>
317
318 <para>
319 When a Windows NT4/200x/XP machine logs onto the network, the client looks in the NETLOGON share on
320 the authenticating domain controller for the presence of the NTConfig.POL file. If one exists it is 
321 downloaded, parsed and then applied to the user's part of the registry.
322 </para>
323
324 <para>
325 <indexterm><primary>GPOs</primary></indexterm>
326 MS Windows 200x/XP clients that log onto an MS Windows Active Directory security domain may additionally
327 acquire policy settings through Group Policy Objects (GPOs) that are defined and stored in Active Directory
328 itself. The key benefit of using AS GPOs is that they impose no registry <emphasis>spoiling</emphasis> effect.
329 This has considerable advantage compared with the use of <filename>NTConfig.POL</filename> (NT4) style policy updates.
330 </para>
331
332 <para>
333 In addition to user access controls that may be imposed or applied via system and/or group policies
334 in a manner that works in conjunction with user profiles, the user management environment under
335 MS Windows NT4/200x/XP allows per domain as well as per user account restrictions to be applied.
336 Common restrictions that are frequently used include:
337 </para>
338
339 <para>
340 <indexterm><primary>Account Controls</primary></indexterm>
341 <itemizedlist>
342         <listitem>Logon hours</listitem>
343         <listitem>Password aging</listitem>
344         <listitem>Permitted logon from certain machines only</listitem>
345         <listitem>Account type (local or global)</listitem>
346         <listitem>User rights</listitem>
347 </itemizedlist>
348 </para>
349
350 <para>
351 Samba-3.0.0 doe not yet implement all account controls that are common to MS Windows NT4/200x/XP.
352 While it is possible to set many controls using the Domain User Manager for MS Windows NT4, only password
353 expirey is functional today. Most of the remaining controls at this time have only stub routines
354 that may eventually be completed to provide actual control. Do not be misled by the fact that a
355 parameter can be set using the NT4 Domain User Manager or in the <filename>NTConfig.POL</filename>.
356 </para>
357
358 </sect1>
359 <sect1>
360 <title>Management Tools</title>
361
362 <para>
363 Anyone who wishes to create or manage Group Policies will need to be familiar with a number of tools.
364 The following sections describe a few key tools that will help you to create a low maintenance user
365 environment.
366 </para>
367
368         <sect2>
369         <title>Samba Editreg Toolset</title>
370
371         <para>
372 <indexterm><primary>editreg</primary></indexterm>
373 <indexterm><primary>NTUser.DAT</primary></indexterm>
374 <indexterm><primary>NTConfig.POL</primary></indexterm>
375         A new tool called <command>editreg</command> is under development. This tool can be used
376         to edit registry files (called <filename>NTUser.DAT</filename>) that are stored in user
377         and group profiles. <filename>NTConfig.POL</filename> files have the same structure as the
378         <filename>NTUser.DAT</filename> file and can be edited using this tool. <command>editreg</command>
379         is being built with the intent to enable <filename>NTConfig.POL</filename> files to be saved in text format and to
380         permit the building of new <filename>NTConfig.POL</filename> files with extended capabilities. It is proving difficult
381         to realize this capability, so do not be surprised if this feature does not materialize. Formal
382         capabilities will be announced at the time that this tool is released for production use.
383         </para>
384
385         </sect2>
386
387         <sect2>
388         <title>Windows NT4/200x</title>
389
390         <para>
391         The tools that may be used to configure these types of controls from the MS Windows environment are:
392         the NT4 User Manager for Domains, the NT4 System and Group Policy Editor, and the Registry Editor (regedt32.exe).
393         Under MS Windows 200x/XP, this is done using the Microsoft Management Console (MMC) with appropriate
394         <quote>snap-ins,</quote> the registry editor, and potentially also the NT4 System and Group Policy Editor.
395         </para>
396         </sect2>
397
398         <sect2>
399         <title>Samba PDC</title>
400
401         <para>
402         With a Samba Domain Controller, the new tools for managing user account and policy information include:
403         <command>smbpasswd</command>, <command>pdbedit</command>, <command>net</command>, <command>rpcclient</command>. 
404         The administrator should read the man pages for these tools and become familiar with their use.
405         </para>
406
407         </sect2>
408 </sect1>
409
410 <sect1>
411 <title>System Startup and Logon Processing Overview</title>
412
413 <para>
414 The following attempts to document the order of processing the system and user policies following a system
415 reboot and as part of the user logon:
416 </para>
417
418 <orderedlist>
419         <listitem><para>
420         Network starts, then Remote Procedure Call System Service (RPCSS) and Multiple Universal Naming
421         Convention Provider (MUP) start.
422         </para></listitem>
423
424         <listitem><para>
425         Where Active Directory is involved, an ordered list of Group Policy Objects (GPOs) is downloaded
426         and applied. The list may include GPOs that:
427 <itemizedlist>
428         <listitem><para>Apply to the location of machines in a Directory.</para></listitem>
429         <listitem><para>Apply only when settings have changed.</para></listitem>
430         <listitem><para>Depend on configuration of the scope of applicability: local,
431         site, domain, organizational unit, and so on.</para></listitem>
432 </itemizedlist>
433         No desktop user interface is presented until the above have been processed.
434         </para></listitem>
435
436         <listitem><para>
437         Execution of start-up scripts (hidden and synchronous by default).
438         </para></listitem>
439
440         <listitem><para>
441         A keyboard action to effect start of logon (Ctrl-Alt-Del).
442         </para></listitem>
443
444         <listitem><para>
445         User credentials are validated, user profile is loaded (depends on policy settings).
446         </para></listitem>
447
448         <listitem><para>
449         An ordered list of user GPOs is obtained. The list contents depends on what is configured in respect of:
450
451 <itemizedlist>
452         <listitem>Is the user a Domain Member, thus subject to particular policies?</listitem>
453         <listitem>Loopback enablement, and the state of the loopback policy (Merge or Replace).</listitem>
454         <listitem>Location of the Active Directory itself.</listitem>
455         <listitem>Has the list of GPOs changed? No processing is needed if not changed.</listitem>
456 </itemizedlist>
457         </para></listitem>
458
459         <listitem><para>
460         User Policies are applied from Active Directory. Note: There are several types.
461         </para></listitem>
462
463         <listitem><para>
464         Logon scripts are run. New to Windows 200x and Active Directory, logon scripts may be obtained based on Group
465         Policy objects (hidden and executed synchronously). NT4-style logon scripts are then run in a normal
466         window.
467         </para></listitem>
468
469         <listitem><para>
470         The User Interface as determined from the GPOs is presented. Note: In a Samba domain (like an NT4
471         Domain), machine (system) policies are applied at start-up; user policies are applied at logon.
472         </para></listitem>
473 </orderedlist>
474
475 </sect1>
476
477 <sect1>
478 <title>Common Errors</title>
479
480 <para>
481 Policy-related problems can be quite difficult to diagnose and even more difficult to rectify. The following
482 collection demonstrates only basic issues.
483 </para>
484
485 <sect2>
486 <title>Policy Does Not Work</title>
487
488 <para>
489 <quote>We have created the <filename>Config.POL</filename> file and put it in the <emphasis>NETLOGON</emphasis> share.
490 It has made no difference to our Win XP Pro machines, they just do not see it. It worked fine with Win 98 but does not
491 work any longer since we upgraded to Win XP Pro. Any hints?</quote>
492 </para>
493
494 <para>
495 Policy files are not portable between Windows 9x/Me and MS Windows NT4/200x/XP-based platforms. You need to
496 use the NT4 Group Policy Editor to create a file called <filename>NTConfig.POL</filename> so it is in the
497 correct format for your MS Windows XP Pro clients.
498 </para>
499
500 </sect2>
501
502 </sect1>
503
504 </chapter>