Author Topic: Logon scripts  (Read 5363 times)

rkiser

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Logon scripts
« on: May 07, 2008, 04:10:23 am »
Hello, I have a question concerning logon scripts.  Is it possible to have a logon script per group?  The problem I am having is I have a group with a share and when I create a logon script to map that share it's applied to all users and it causes the logon script to ask for a username when they log in and they are not in that group.  Any suggestions?  Thanks!

jcanfield

  • Zen Monk
  • **
  • Posts: 89
  • Karma: +2/-0
    • View Profile
Re: Logon scripts
« Reply #1 on: May 08, 2008, 04:39:10 am »
The NT resource kit comes with a utility called IFMEMBER.EXE.    Google it, you will find many useful ways of mapping group shares via logon scripts. 

Note:  Remember to use unix2dos utilty on your scripts after editing on your ebox server.


Here's a script I snipped from the net some time ago....

Code: [Select]
rem check for resource utility
IF NOT EXIST %windir%\IFMEMBER.EXE copy \\PDC\netlogon\ifmember.exe %windir%

rem this section maps the G: and H: drives
rem to the appropriate directories on Mercury28 for Premis.
IFMEMBER premis
IF NOT %errorlevel% EQU 1 GOTO OPTIKA
net use G: \\mercury28\ndc$ /persistent:no
net use H: \\mercury28\purge$ /persistent:no

:OPTIKA
REM MAP DRIVE FOR Optika O: Drive
IFMEMBER optika
IF NOT %errorlevel% EQU 1 GOTO MIDAS
NET USE O: \\ATHENA15\Optika$ /PERSISTENT:NO

:MIDAS
rem This section maps M: to the mids share
IFMEMBER mids_group
IF NOT %errorlevel% EQU 1 GOTO DONE
net use M: \\athena15\Mids /PERSISTENT:NO

:DONE
EXIT
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius...and a lot of courage - to move in the opposite direction."  --  Albert Einstein

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: Logon scripts
« Reply #2 on: May 08, 2008, 10:46:58 am »
This script is great!

Never really seen a Win-like script  :D
My secret is my silence...

patcunha

  • Zen Apprentice
  • *
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Logon scripts
« Reply #3 on: May 24, 2008, 12:46:12 pm »
Where shall I put the logon scripts?

rkiser

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Logon scripts
« Reply #4 on: June 23, 2008, 07:57:28 pm »
Where shall I put the logon scripts?

You should put them under /home/samba/netlogon/
Also for simplicity name it logon.bat.

dragonslayr

  • Zen Warrior
  • ***
  • Posts: 157
  • Karma: +1/-0
    • View Profile
Re: Logon scripts
« Reply #5 on: August 23, 2009, 03:47:19 pm »
I realize this is an old thread, but on ebox 1.2, what is easiest way to make the netlogon directory writable to the administrator, so it can be updated from his workstation easily?