如何在新建域用户的时候,为这个用户同时建立多个映射的磁盘

如题所述

是通过组策略执行开机脚本,映射多个网络驱动器的!
脚本如下,保存为VBS即可!
1、此脚本作用是映射文件服务器上的三个共享文件夹"临时交流,当期1,当期"
On error resume next
strRemoteIP = "\\10.15.0.5\"
strfolder = "临时交流,当期1,当期"
strNewNames = split(strfolder,",")

For x = 0 To UBound(strNewNames) Step 1

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")
strRemotePath = strRemoteIP & strNewNames(x)
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

' Section which actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNewNames(x)

next

2、跟第1种情况结果不太一样,测试一下就知道了!
Set WshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "x:", "\\Fileserver01\Users$\" & wshNetwork.UserName
wshNetwork.MapNetworkDrive "z:", "\\Fileserver01\department$\it"
wshNetwork.MapNetworkDrive "y:", "\\Fileserver01\company$"
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答