diff options
author | Gerald Carter <jerry@samba.org> | 2005-11-10 14:30:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:22 -0500 |
commit | e04e7e1ffcf0ad4c8a3837f8553ea83f6b49166d (patch) | |
tree | 8d0c2c70c05311cdb74bf6a462716d0ef87cd3d3 /examples/logon | |
parent | c672a17ff09a7cbe4982c221090ba82377e1a044 (diff) | |
download | samba-e04e7e1ffcf0ad4c8a3837f8553ea83f6b49166d.tar.gz |
r11645: mklogon updates from Ricky Nance
(This used to be commit 5bfa88225c085238954909fb9aedb34b1b760977)
Diffstat (limited to 'examples/logon')
-rw-r--r-- | examples/logon/mklogon/mklogon.conf | 75 | ||||
-rw-r--r-- | examples/logon/mklogon/mklogon.pl | 50 |
2 files changed, 68 insertions, 57 deletions
diff --git a/examples/logon/mklogon/mklogon.conf b/examples/logon/mklogon/mklogon.conf index 1f1faa77e38..b04708977c4 100644 --- a/examples/logon/mklogon/mklogon.conf +++ b/examples/logon/mklogon/mklogon.conf @@ -6,72 +6,73 @@ # infront of your # on a comment it breaks ... # logging = yes # Should Logging be enabled (YES,ON,1 or NO,OFF,0)(if not specified defaults to no) # logdir = "/root/perl" # What is the base directory the logs should be stored. -# logfile = "userlogs.txt" # What should the file be named. -# logtype = file (default) # file will log to the file specified, syslog is well... the system logs ;) +# logfile = "userlist.txt" # What should the file be named. +# VERY IMPORTANT anything that has a "\" (backslash) in it ex. "C:\" MUST be changed to a double "\\" for +# it to be used in the script. ex. "C:\\" [global] logging = yes logdir = "/home/samba/netlogon" logfile = "UserLogs.txt" -logtype = system mkprofile = 1 timesync = yes sambaconf = "/etc/samba/smb.conf" +logtype = file # Change and uncomment the below value to force the servername, some clients ocassionally # have trouble picking up the right servername so it may need to be set. It CANNOT be left blank AND uncommented. -# servername = staticservername +servername = "TIGER" [common] public = P:, public home = H:, /home [groupmap] -admin = Y:, UTILS -adm = R:, NETLOGON +adm = R:, NETLOGON, Y:, ARCHIVES +teachers = S:, RECORDS, X:, SIS +plato = T:, PLATO +webpage = W:, WEB +hsoffice = N:, HSOFFICE, Q:, COMMON, X:, SIS +suoffice = N:, super, Q:, COMMON, X:, SIS +emoffice = N:, emOFFICE, Q:, COMMON, X:, SIS +tech = O:, utils +yearbook = Y:, yearbook [usermap] -user1 = G:, GHOST -beanbags = Q:, STAR -avinst = P:\\vexira\\vexprof.bat +rnance = G:, GHOST, I:, TTL, Y:, ARCHIVES, R:, NETLOGON, X:, SIS +lwatts = G:, GHOST, I:, TTL, Y:, ARCHIVES, R:, NETLOGON, X:, SIS +droot = U:, stuhomes +2007mbk = Y:, yearbook +2008mll = Y:, yearbook +2008jtj = Y:, yearbook +2007tja = Y:, yearbook +2007hms = Y:, yearbook +2006dpv = Y:, yearbook +2006jwb2 = Y:, yearbook +2007npd = Y:, yearbook +astewart = Y:, yearbook + + # Here is where things get confusing, you can assign a computer, or make a group of computers. -# The same context will go for ip address's as well. +# The same context will go for ip address's as well, however you can also specify ip ranges, +# but I have not yet figured out how to do multiple ranges. # Use the following examples for help. # To define a single computer to do commands # mymachinename = command1, command2 # To define a group of computers to do commands # mymachinegroup = machinename1, machinename2 -# [preformcommands] +# [performcommands] # mymachinegroup = command1,command2 +# iprangegroup1 = 10.1.2.1 - 10.1.3.1 -[machines] -#emints 1 is jf -emints1 = school-w88zfod9, school-o8axvv6t, school-mmtudgbo, school-dpokmajd, school-m84hx4iw, school-74548k1j, school-vou4gdap, school-qfuw5uho -#emints 2 is kh -emints2 = school-w7loulcx, school-2tbh64eu, school-uunqieuz, school-pow35do4, school-x0v0cbiz, school-zu5qyjhw, school-l4q4j32o -[ip] -ipgroup1 = 10.5.1.1 - 10.5.1.10, 10.1.1.255/24 -ipgroup2 = 10.1.1.1 -# This is the section where you can specify things according to the operating system of the client. -# The clients OS -- Windows 95/98/ME (Win95), Windows NT (WinNT), -# Windows 2000 (Win2K), Windows XP (WinXP), and Windows 2003 -# (Win2K3). Anything else will be known as ``UNKNOWN'' -# That snippet is directly from man smb.conf. -# +[machines] -[os] -Win95 = REM your computer is windows 9x based -WinNT = -Win2K = -WinXP = -Win2K3 = -UNKNOWN = +[ip] +sixthemints = 10.1.5.201 - 10.1.5.215 -[preformcommands] -emints1 = START \\\\JF-TEACHER\\Brother, START \\\\JF-TEACHER\\Canon, REGEDIT /S P:\\SETHOME-JF.REG, your in emints 1 -emints2 = START \\\\s0034292474\\Brother, START \\\\s0034292474\\Canon, REGEDIT /S P:\\SETHOME-KH.REG -ipgroup1 = echo your in the ip group -ipgroup2 = echo your in the ip group 2, start command.com +[performcommands] +common = "XCOPY P:\\TYPEN32.INI C:\\WINDOWS\\ /Y \>NUL", "XCOPY P:\\ARPROGRAMS\\DBLOCATION\\\*\.\* C:\\WINDOWS\\ /Y \>NUL", "XCOPY P:\\EMACTIVITIES\\EMGAMESPREFS.INI C:\\WINDOWS\\ /Y \>NUL", "PATH\=\%PATH\%;p:\\PXPerl\parrot\\bin;p:\\PXPerl\\bin" +sixthemints = "start \\\\10.1.5.20\\printer" diff --git a/examples/logon/mklogon/mklogon.pl b/examples/logon/mklogon/mklogon.pl index 88ee97c9799..8bea7b22d36 100644 --- a/examples/logon/mklogon/mklogon.pl +++ b/examples/logon/mklogon/mklogon.pl @@ -22,8 +22,8 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Version: 1.1 Beta -# Revised: 06/28/2005 +# Version: 1.0 (Stable) +# Revised: 07/28/2005 # Comments... # Working on logging to the system logs, Logs user activity, but not errors yet. @@ -144,11 +144,11 @@ if ( defined($smbprof) ) { print "$smbprof \n"; print "$dir2 \n"; if ( !-e $dir2 ) { - print "Creating " . $user . "'s profile \n"; + print "Creating " . $user . "'s profile with a uid of $uid\n"; mkdir $smbprof; mkdir $dir2; chomp($user); - chown $uid, $gid, $smbprof; +# chown $uid, $gid, $smbprof; chown $uid, $gid, $dir2; } else { print $user . "'s profile already exists \n"; @@ -174,6 +174,13 @@ for my $key ( keys %$common ) { drive_map( @{ $common->{$key} } ); } +my @perform_common = $cfg->param("performcommands.common"); +if ( defined( $perform_common[0] ) ) { + foreach (@perform_common) { + print LOGON "$_ \r\n"; + } +} + # Map shares on a per user basis. drive_map(@username); @@ -195,30 +202,33 @@ for my $key ( keys %$compname ) { if ( ref $test eq 'ARRAY' ) { foreach (@$test) { if ( $_ eq $machine ) { - my $preformit = $cfg->param("preformcommands.$key"); - if ( defined($preformit) ) { - if ( ref $preformit ) { - foreach (@$preformit) { print LOGON "$_ \r\n"; } + my $performit = $cfg->param("performcommands.$key"); + if ( defined($performit) ) { + if ( ref $performit ) { + foreach (@$performit) { print LOGON "$_ \r\n"; } } else { - print LOGON "$preformit \r\n"; + print LOGON "$performit \r\n"; } } } } } elsif ( $test eq $machine ) { - my $preformit = $cfg->param("preformcommands.$key"); - if ( defined($preformit) ) { - if ( ref $preformit ) { - foreach (@$preformit) { print LOGON "$_ \r\n"; } + my $performit = $cfg->param("performcommands.$key"); + if ( defined($performit) ) { + if ( ref $performit ) { + foreach (@$performit) { print LOGON "$_ \r\n"; } } else { - print LOGON "$preformit \r\n"; + print LOGON "$performit \r\n"; } } } } # Here is where we test the ip address against the client to see if they have "Special Mapping" +# A huge portion of the ip matching code was made by +# Carsten Schaub (rcsu in the #samba chan on freenode.net) + my $val; for my $key ( sort keys %$ipname ) { if ( ref $ipname->{$key} eq 'ARRAY' ) { @@ -234,12 +244,12 @@ sub getipval { my ( $range, $rangename ) = @_; if ( parse( $ip, ipmap($range) ) ) { if ( $val eq 'true' ) { - my $preformit = $cfg->param("preformcommands.$rangename"); - if ( defined($preformit) ) { - if ( ref $preformit ) { - foreach (@$preformit) { print LOGON "$_ \r\n"; } + my $performit = $cfg->param("performcommands.$rangename"); + if ( defined($performit) ) { + if ( ref $performit ) { + foreach (@$performit) { print LOGON "$_ \r\n"; } } else { - print LOGON "$preformit \r\n"; + print LOGON "$performit \r\n"; } } } elsif ( $val eq 'false' ) { @@ -307,7 +317,7 @@ sub drive_map { my $sharename = $data[$i]; $i++; if ( $sharename eq '/home' ) { - print LOGON uc("NET USE $driveletter $sharename \/Y \r\n"); + print LOGON uc("NET USE $driveletter \\\\$server\\$user \/Y \r\n"); } else { print LOGON uc("NET USE $driveletter \\\\$server\\$sharename \/Y \r\n"); |