Script para Netlogon

Segue um sample para automatização de mapeamentos no processo de logon

Option Explicit
On Error Resume Next

Dim objNet, wshNet, CurrentUser, grp, WshShell

Set WshShell = CreateObject(“WScript.Shell”)
Set wshNet = CreateObject(“WScript.Network”)
Set objNet = CreateObject(“WScript.Network”)

Set CurrentUser = _
GetObject(“WinNT://DOMINIO/” & wshNet.Username & “,user”)

For Each grp In CurrentUser.Groups
MapDrive grp.Name
Next

Sub MapDrive(byval strGroupname)
if InStr(strGroupName, “grpAtendimento”) then
map “y:”,”\\ServidordeArquivos\Corporativo$\atendimento”
end if
End Sub

Sub Map (drive, location)
objnet.MapNetworkDrive drive,location
End sub

Deixe uma resposta