首先我们在Active Directory 用户和计算机工具中,在用户的配置文件下的登陆脚本里输入如下
然后我们在域共享\\nccn.int\NETLOGON\ 下新建一个NEO.bat的文件内容如下
--------------------------------------------
@echo off
cmd /c
%logonserver%\netlogon\KIX32.EXE %logonserver%\netlogon\kixtart.kix
exit
--------------------------------------------
同进把kixtart的脚本执行程序kix32也复制到\\nccn.int\NETLOGON\
另外在\\nccn.int\NETLOGON\ 下,再建一个kixtart.kix的文件(可以直接用记事本编缉,不过推荐用第三方编缉工具,如Notepad++)
kixtart.kix内容 :
--------------------------------------------
SETCONSOLE ("ALWAYSONTOP")
$SUBNET = Ltrim(SubStr(@IPADDRESS0, 1, 8))
$TEMP = @IPADDRESS0
$IP=""
FOR $Counter=1 TO 15
IF SUBSTR($TEMP,$Counter,1) = " "
$IP=$IP + "0"
ELSE
$IP=$IP + SUBSTR($TEMP,$Counter,1)
ENDIF
NEXT
$Network=SUBSTR($IP,1,11)
COLOR b/b
BOX (0,0,24,80,FULL)
COLOR y+/b
AT ( 1,1) "Good morning! " @fullname "^_^"
AT ( 2,1) "**************************************"
AT ( 3,1) "Drive Mappings"
;Use J: /delete
USE J: "\\nccn.int\PublicShare"
;下面根据不同AD用户组映射盘符
IF INGROUP ("SIU(Write)")
Use S: /delete
USE S: "\\192.168.20.5\设计组"
ENDIF
IF INGROUP ("NCG-Shipping(Write)")
;Use S: /delete
USE S: "\\192.168.38.4\iTVS"
ENDIF
IF INGROUP ("ZSITSupport")
USE V: "\\192.168.38.33\ITShare"
ENDIF
AT (3,1) USE List
SLEEP (6)
EXIT
--------------------------------------------