Well it works for me! This is probably more appropriate for the scripting forum but hey check this logon script...
' ---------------------------------------------------------
' Logon Script
' ---------------------------------------------------------
' Start of VB Script code for Windows Scripting Host (WSH)
' Create WSH objects and populate from the Domain/AD
set wshNetwork = WScript.CreateObject("WScript.Network"
set wshShell = WScript.CreateObject("WScript.Shell"
' Wait for up to 30 seconds
HurryUp = Timer + 30
Do
Wscript.Sleep 100 ' Check every 100mS
Loop until wshNetwork.username <> "" or HurryUp < Timer
If wshNetwork.username="" then ProblemGettingDomainData
'Set some variables
User = wshNetwork.username
Domain = wshNetwork.userdomain
computer = wshNetwork.computername
'Determine the users Domain/AD Group membership
adspath="WinNT://" & domain & "/" & user
'Create an object and populate it with users
set adsobj = getobject(adspath)
'Map Drives based on Group Membership
'Users can belong to many groups. The group name for every group that the user belongs to is
'passed through a "select case" test. If the group name under test matches any "case" statement,
'then the line(s) under the "case" statement is actioned.
'Cycle through the user's group membership list
for each prop in adsobj.groups
'Pass the name of the group through the following filter
Select case prop.name
case "D_NewZealand" ' User is a member of this group so...
mapNetwork "S:", "\\nzdatasr01\data"
end select ' Finish the filter test for this group name
'Loop around until every entry in the group membership list has been tested
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.