[Samba] universal netlogon script

Charles Marcus CMarcus at Media-Brokers.com
Wed Sep 3 14:37:24 GMT 2008


On 9/3/2008 9:04 AM, Brad C wrote:
> Hi Guys,
> 
> Advise, I have 200 users, they all have access to 20 shares in different
> combinations. They all have their own netlogon scripts... its a management
> nightmare,
> is there a way to create a universal netlogon script that I can include all
> the shares to mount and it will silently fail on the ones it cant? Perhaps
> there is a smarter way to implement this idea,

Here's mine (anonymized) - no error-checking is done, but its simple,
and been working fine for many years:

:begin
echo off
cls
net time \\mypdc /set /y

:: first unmap all possible mapped drives, then map all drives
:: common to all users
call \\mypdc\netlogon\unmap-all.bat
call \\mypdc\netlogon\map-all.bat

if %username% == user1 net use f: \\servername\share1 /persistent:no

:: map drive for Group1
\\mypdc\netlogon\ismember "MyDomain\Group1"
if errorlevel 1 net use j: \\mypdc\share2 /persistent:no

:: map drives for Group2
\\mypdc\netlogon\ismember "MyDomain\Group2"
if errorlevel 1 call \\mypdc\netlogon\group2.bat

:: map drive for Group3
\\mypdc\netlogon\ismember "MyDomain\Group3"
if errorlevel 1 net use q: \\servername\share3 /persistent:no

:: map drive for Group4
\\mypdc\netlogon\ismember "MyDomain\Group4"
if errorlevel 1 net use s: \\mypdc\share4 /persistent:no

:end

This script only requires that the ismember.exe executable be placed in
the NETLOGON share.

-- 

Best regards,

Charles


More information about the samba mailing list