ON ERROR RESUME NEXT
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "DomainName"
UserString = WSHNetwork.UserName
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'Synchronizes the time with Server our NTP Server
WSHShell.Run "NET TIME \\LICSRV /set /y"
WSHShell.Run "NETLOGON DST-Update.bat"
' remove drives
DIM objNetwork,colDrives,i
Set objNetwork = CreateObject("Wscript.Network")
Set colDrives = objNetwork.EnumNetworkDrives
For i = 0 to colDrives.Count-1 Step 2
' Force Removal of network drive and remove from user profile
' objNetwork.RemoveNetworkDrive strName, [bForce], [bUpdateProfile]
objNetwork.RemoveNetworkDrive colDrives.Item(i),TRUE,TRUE
Next
wscript.sleep 300
'Maps drives needed by all
WSHNetwork.MapNetworkDrive "F:", "\\LICSRV\DATA",True
WSHNetwork.MapNetworkDrive "Z:", "\\LICSRV\public",True
WSHNetwork.MapNetworkDrive "P:", "\\LICSRV\Premise",True
WSHNetwork.MapNetworkDrive "M:", "\\LICSRV\MED IQ",True
WSHNetwork.MapNetworkDrive "S:", "\\LICSRV\SCANS",True
WSHNetwork.MapNetworkDrive "L:", "\\LICSRV\LEGAL",True
WSHNetwork.MapNetworkDrive "w:", "\\NASLIC\NASpublic",True
WSHNetwork.MapNetworkDrive "V:", "\\NASLIC\NASefiles",True
'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "Admin"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Admin Stuff",True
Case "WorkerB"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True
End Select
Next
'Disconnect a network printer
WSHNetwork.RemovePrinterConnection "\\LICSRV\DP6030_BACK"
'Disconnect a network drive
'Install Printers
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER1"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER2"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER3"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER4"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER5"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER6"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER8"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER9"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER10"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER7"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER11"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER12"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\PRINTER13"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\Zebra1"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP-8060"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP-6030"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP-8060_NEW1"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP-8060_NEW2"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP6030_BACK"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\TOSHIBA_COPIER"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\ZEBRA2"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\LANIER"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\ZEBRA3"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP-8060_NEW3"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\TOSHIBA_eStudio603"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\LANIER_FAX_LD320D"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\DP6030_NEW1"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\TOSHIBA_655NEW"
WSHNetwork.AddWindowsPrinterConnection "\\LICSRV\TOSHIBA_655NEW1"
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
wscript.quit
|