e6e734729038bae6337665fd72bc082d1c065aad
[samba.git] / docs / docbook / projdoc / AdvancedNetworkAdmin.xml
1 <chapter id="AdvancedNetworkManagement">
2 <chapterinfo>
3         &author.jht;
4     <pubdate>April 3 2003</pubdate>
5 </chapterinfo>
6
7 <title>Advanced Network Manangement</title>
8
9 <para>
10 This section attempts to document peripheral issues that are of great importance to network
11 administrators who want to improve network resource access control, to automate the user
12 environment, and to make their lives a little easier.
13 </para>
14
15 <sect1>
16 <title>Remote Server Administration</title>
17
18 <para>
19 <emphasis>How do I get 'User Manager' and 'Server Manager'?</emphasis>
20 </para>
21
22 <para>
23 Since I don't need to buy an NT4 Server, how do I get the 'User Manager for Domains',
24 the 'Server Manager'?
25 </para>
26
27 <para>
28 Microsoft distributes a version of these tools called nexus for installation on Windows 9x / Me
29 systems.  The tools set includes:
30 </para>
31
32 <itemizedlist>
33         <listitem><para>Server Manager</para></listitem> 
34         <listitem><para>User Manager for Domains</para></listitem> 
35         <listitem><para>Event Viewer</para></listitem> 
36 </itemizedlist>
37
38 <para>
39 Click here to download the archived file <ulink 
40 url="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</ulink>
41 </para>
42
43 <para>
44 The Windows NT 4.0 version of the 'User Manager for 
45 Domains' and 'Server Manager' are available from Microsoft via ftp 
46 from <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</ulink>
47 </para>
48
49 </sect1>
50 <sect1>
51 <title>Network Logon Script Magic</title>
52
53 <para>
54 This section needs work. Volunteer contributions most welcome. Please send your patches or updates
55 to <ulink url="mailto:jht@samba.org">John Terpstra</ulink>.
56 </para>
57
58 <para>
59 There are several opportunities for creating a custom network startup configuration environment.
60 </para>
61
62 <simplelist>
63         <member>No Logon Script</member>
64         <member>Simple universal Logon Script that applies to all users</member>
65         <member>Use of a conditional Logon Script that applies per user or per group attirbutes</member>
66         <member>Use of Samba's Preexec and Postexec functions on access to the NETLOGON share to create
67         a custom Logon Script and then execute it.</member>
68         <member>User of a tool such as KixStart</member>
69 </simplelist>
70
71 <para>
72 The Samba source code tree includes two logon script generation/execution tools. See <filename>examples</filename> directory <filename>genlogon</filename> and <filename>ntlogon</filename> subdirectories.
73 </para>
74
75 <para>
76 The following listings are from the genlogon directory.
77 </para>
78
79 <para>
80 This is the genlogon.pl file:
81
82 <programlisting>
83         #!/usr/bin/perl
84         #
85         # genlogon.pl
86         #
87         # Perl script to generate user logon scripts on the fly, when users
88         # connect from a Windows client.  This script should be called from smb.conf
89         # with the %U, %G and %L parameters. I.e:
90         #
91         #       root preexec = genlogon.pl %U %G %L
92         #
93         # The script generated will perform
94         # the following:
95         #
96         # 1. Log the user connection to /var/log/samba/netlogon.log
97         # 2. Set the PC's time to the Linux server time (which is maintained
98         #    daily to the National Institute of Standard's Atomic clock on the
99         #    internet.
100         # 3. Connect the user's home drive to H: (H for Home).
101         # 4. Connect common drives that everyone uses.
102         # 5. Connect group-specific drives for certain user groups.
103         # 6. Connect user-specific drives for certain users.
104         # 7. Connect network printers.
105
106         # Log client connection
107         #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
108         ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
109         open LOG, ">>/var/log/samba/netlogon.log";
110         print LOG "$mon/$mday/$year $hour:$min:$sec - User $ARGV[0] logged into $ARGV[1]\n";
111         close LOG;
112
113         # Start generating logon script
114         open LOGON, ">/shared/netlogon/$ARGV[0].bat";
115         print LOGON "\@ECHO OFF\r\n";
116
117         # Connect shares just use by Software Development group
118         if ($ARGV[1] eq "SOFTDEV" || $ARGV[0] eq "softdev")
119         {
120                 print LOGON "NET USE M: \\\\$ARGV[2]\\SOURCE\r\n";
121         }
122
123         # Connect shares just use by Technical Support staff
124         if ($ARGV[1] eq "SUPPORT" || $ARGV[0] eq "support")
125         {
126                 print LOGON "NET USE S: \\\\$ARGV[2]\\SUPPORT\r\n";
127         }
128
129         # Connect shares just used by Administration staff
130         If ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
131         {
132                 print LOGON "NET USE L: \\\\$ARGV[2]\\ADMIN\r\n";
133                 print LOGON "NET USE K: \\\\$ARGV[2]\\MKTING\r\n";
134         }
135
136         # Now connect Printers.  We handle just two or three users a little
137         # differently, because they are the exceptions that have desktop
138         # printers on LPT1: - all other user's go to the LaserJet on the
139         # server.
140         if ($ARGV[0] eq 'jim'
141             || $ARGV[0] eq 'yvonne')
142         {
143                 print LOGON "NET USE LPT2: \\\\$ARGV[2]\\LJET3\r\n";
144                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
145         }
146         else
147         {
148                 print LOGON "NET USE LPT1: \\\\$ARGV[2]\\LJET3\r\n";
149                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
150         }
151
152         # All done! Close the output file.
153         close LOGON;
154 </programlisting>
155 </para>
156
157 <para>
158 Those wishing to use more elaborate or capable logon processing system should check out the following sites:
159 </para>
160
161 <simplelist>
162         <member>http://www.craigelachie.org/rhacer/ntlogon</member>
163         <member>http://www.kixtart.org</member>
164         <member>http://support.microsoft.com/default.asp?scid=kb;en-us;189105</member>
165 </simplelist>
166
167 <sect2>
168 <title>Adding printers without user intervention</title>
169
170 <para>
171 Printers may be added automatically during logon script processing through the use of:
172
173 <programlisting>
174         rundll32 printui.dll,PrintUIEntry /?
175 </programlisting>
176
177 See the documentation in the Microsoft knowledgebase article no: 189105 referred to above.
178 </para>
179 </sect2>
180
181 </sect1>
182 </chapter>
183