VBS Login Script issue
- From: "bexy" <becky_joseph@xxxxxxxxxx>
- Date: 19 May 2005 09:35:27 -0700
I am trying to write a script that maps a drive on the basis of which
Active Directory user group, a user is part of.
This is what i have so far... but it doesnt seem to work, so I am
obviously doing something intrinsicly wrong.
Option Explicit
Dim objNetwork
Dim strUserDN,objUser
Dim objGroup1
Set objNetwork = CreateObject("WScript.Network")
' Bind to the user object in Active Directory with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
' Bind to a group object in Active Directory with the LDAP provider.
Set objGroup1 = GetObject("LDAP://ou=Desktop Services,ou=User
Areas,dc=igi,dc=ig,dc=local")
' Map a network drive if the user is a member of the group.
If objGroup1.IsMember(objUser.AdsPath) Then
On Error Resume Next
objNetwork.MapNetworkDrive "W:", "\\igserv1\users"
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDrive "W:", True, True
objNetwork.MapNetworkDrive "W:", "\\igserv1\users"
End If
On Error GoTo 0
End If
'Clean Up.
Set objNetwork = Nothing
Set objUser = Nothing
Set objGroup1 = Nothing
please help.
Becky
.
- Follow-Ups:
- RE: VBS Login Script issue
- From: Arkane
- RE: VBS Login Script issue
- Prev by Date: RE: Major problem regarding applying GPO
- Next by Date: Re: Windows 2003 domain functional level
- Previous by thread: Windows 2003 domain functional level
- Next by thread: RE: VBS Login Script issue
- Index(es):
Relevant Pages
|