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