为管理员应该主动的部署服务,将可用资源送至客户端而不要让用户自己去找,因为这样做,一需要对用户进行额外的培训,二用户需要更多的权限,三可能导致安
全性的问题。 在ad中发布共享资源,只是将已经存在的共享资源发布到ad中,便于用户搜索,这是一个逻辑的再组织,这个动作并不会对物理资源造 成影响。 所以一般对于ad中的共享文件夹的部署,可以使用用户登陆脚本为客户端直接作映射,这个映射可以直接映射共享文件夹,也可以映射dfs node,这样用户就可以像使用本地资源一样使用它们,而不用自己去寻找,从而提高了用户体验。 代码来自winos.cn,这段脚本 很强大,实现了盘符智能化分配,解决了盘符冲突的问题。不得不感慨,脚本的力量就是强大阿,得好好学学了 On error resume next strRemotePath = "\\win2003pdc\vbsedit" strNewName = "网络硬盘" Set objNetwork = CreateObject("Wscript.Network") Set colDrives = objNetwork.EnumNetworkDrives For i = 0 to colDrives.Count-1 Step 2 strDriveLetter = Chr(Asc(Left(colDrives.Item(i),1))-1) & ":" Next If strDriveLetter= "" Then strDriveLetter="Z:" ' Section to map the network drive Set objNetwork = CreateObject("WScript.Network") objNetwork.MapNetworkDrive strDriveLetter, strRemotePath ' Section which actually (re)names the Mapped Drive Set objShell = CreateObject("Shell.Application") objShell.NameSpace(strDriveLetter).Self.Name = strNewName 可以带上用户名和密码参数的……,如果要求帐户密码的话 MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword]) --------------------------------------------------------- --------------------------------------------------------- 修改这一句 objNetwork.MapNetworkDrive strDriveLetter, strRemotePath,,strUser,strPassword 然后在最开始赋值给 strUser 比如 strUser = User1 strPassword 比如 strPassword = pass@word1 ---------------------------- ---------------------------- 打印机脚本 Set WshNetwork = CreateObject("WScript.Network") WshNetwork.AddWindowsPrinterConnection "\??.168.0.1\print1" WshNetwork.AddWindowsPrinterConnection "\??.168.0.1\print2" WshNetwork.SetDefaultPrinter "\??.168.0.6\print1" |
|
来自: clardemasol > 《活动目录》