source: branches/samba-3.0/examples/logon/ntlogon/README

Last change on this file was 1, checked in by Paul Smedley, 18 years ago

Initial code import

File size: 5.2 KB
Line 
1ntlogon.py v0.8b Copyright 2002 by Timothy (rhacer) Grant
2This programme is released under the terms of the GNU Public License
3This programme has NO WARRANTY of any kind, use at your own risk.
4
5===================
6CHANGES SINCE v0.7b
7===================
8included patch that made machine name %m a macro substitution value.
9Thanks to: Nick Lopez <kimo_sabe@atdot.org>
10
11==================
12CHANGES SINCE v0.6
13==================
14PLEASE NOT THAT I AM CONSIDERING THIS A BETA UNTIL I GET SOME FEEDBACK
15FROM USERS ON WHETHER THE MACRO FEATURE WORKS FOR THEM.
16
17added the ability to define substitution macros: see the useage section
18
19removed the large docstring from the file and moved the information to
20the USEAGE section of this file
21
22cleaned up the code and made more flexible
23
24improved the code comments
25
26==================
27CHANGES SINCE v0.5
28==================
29added a -v --version switch
30
31added a --pause switch which will put a pause statement between each
32non-blank line of the script.
33
34===============
35A PERSONAL NOTE
36===============
37When I originally posted v0.5 on Freshmeat, I really expected *some*
38feedback. To date this little script has been downloaded over 700 times, but
39absolutely nobody has sent me an e-mail to tell me if it is useful, or if
40it is absolutely the stupidest waste of bandwidth they have ever seen.
41I'd really love to know if even one person other than me and the other techs
42here at Avalon have found it useful.
43
44Thanks.
45 rhacer (rhacer@craigelachie.org)
46
47September 27, 2000
48Thanks to those that did respond to my plea! I'd still love to hear from
49any other users!
50
51============
52INTRODUCTION
53============
54As my experience with Linux and Samba increased, I had no trouble whipping up
55a custom Perl, Python or Bash script to create Samba Logon Scripts, but I
56noticed that I changed things from place to place, and that my users had *no*
57chance of ever figuring out how to modify those scripts themselves.
58
59In an attempt to create a company wide standard that both my co-workers and my
60customers could *easily* modify I hit upon the scheme I used here.
61
62I settled on an INI file feel, because most who have experience with Win boxes
63have some concept of INI files.
64
65============
66INSTALLATION
67============
68The distribution archive contains three files:
69
70README This file
71ntlogon.py The actual Python script (place in /usr/local/samba/bin)
72ntlogon.conf A sample configuration file (place in /etc)
73
74This script was created using Python v1.5.2, and I believe it uses only
75standard libraries.
76
77Your smb.conf file needs to contain a netlogon section similar to the
78following (These settings *are not* normal on a RH box. These settings
79are all based on the excellent book that I learned Samba from: Samba
80Integrating Unix and Windows by John D. Blair. It is somewhat out of
81date now, but that's the history of the strange file locations):
82
83[netlogon]
84 path = /usr/local/samba/netlogon
85 writeable = no
86 guest ok = no
87 root preexec = /usr/local/samba/bin/ntlogon --user=%U --os=%m
88 root postexec = rm /usr/local/samba/netlogon/%U.bat
89
90======
91USEAGE
92======
93PLEASE SEE NTLOGON.CONF FOR A DETAILED CONFIGURATION EXAMPLE
94
95This programme will build a Windows NT logon script for users connecting
96to a Samba server. Samba macros that are curently understood:
97
98 %U user name
99 %G group name
100 %a machine architecture
101 %m machine netbios name
102
103This programme reads a configuration that looks strikingly similar to both
104the Samba configuration file, and a DOS "boot menu" AUTOEXEC.BAT file.
105
106The default file name is /etc/ntlogon.conf (though I really think it ought
107to be called ntlogon.batch!) You may change the filename by using the -f
108or --templatefile startup option.
109
110The default netlogon directory is /usr/local/samba/netlogon though this
111can be changed with the -d or --dir startup option.
112
113The default batch file name generated is username.bat if no username is
114specified the default value is logon.bat (e.g., if --user=fred is specified
115on the command line then the logon script generated will be stored in
116fred.bat)
117
118Use the --debug option to print the logon script to screen instead of the
119output file
120
121Use the --pause option to place a pause statement between each line of the
122script to assist in debugging a logon script.
123
124The file is divided into sections that have headers in square brackets
125
126[Global]
127[User-username]
128[Group-groupname]
129[OS-osname]
130
131The file may also contain user defined substitution macros. They are
132defined by placing the macro name on the left side of an equal sign,
133and the substitution text on the right side of the equal sign. They
134are also case sensitive:
135
136MAINDRIVE = G:
137USERDRIVE = U:
138SERVERNAME = myservername
139
140They are referenced by prepending a "%" sign to the variable name:
141
142NET USE %MAINDRIVE \\\\servername\\mainshare /YES
143NET USE %USERDRIVE \\\\%SERVERNAME\\usershare /YES
144
145==============
146SPECIAL THANKS
147==============
148Nick Lopez <kimo_sabe@atdot.org> for the net bios name patch.
149
150===================
151CONTACT INFORMATION
152===================
153Author : Timothy (rhacer) Grant
154
155I can be reached at tjg@craigelachie.org
156ntlogon website www.craigelachie.org/rhacer/ntlogon
157
158Please feel free to contact me with any suggestions, improvements, bugs you
159might find.
160
Note: See TracBrowser for help on using the repository browser.