Hello All scripting pros out there.. I'm working on a logon script I converted from DOS and I ran into a problem with a function Im using to map a user to a drive.
I keep getting a syntax and compilation error with the code below
[*************************** Function to check dual memebership ********************************************
If InGroup("LANDESKGROUP") Then
bjNetwork.MapNetworkDrive "Q:", "\\aclfs.site.acllab.net\IS"
Else
MsgBox("Call Login script1")
End If
If InGroup("Domain Users") Then
objNetwork.MapNetworkDrive "N:", "\\ACLHEATDB001\Heat Attachments"
Else
MsgBox("Call login script2")
Function InGroup(strGroupName)
Set objNetwork = CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strUser = objNetwork.UserName
bIsMember = False
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
For Each objGroup In objUser.Groups
If objGroup.Name = strGroupName Then
bIsMember = True
Exit For
End If
Next
InGroup = bIsMember
End Function]
Any assistance is greatly appreciated
I keep getting a syntax and compilation error with the code below
[*************************** Function to check dual memebership ********************************************
If InGroup("LANDESKGROUP") Then
bjNetwork.MapNetworkDrive "Q:", "\\aclfs.site.acllab.net\IS"
Else
MsgBox("Call Login script1")
End If
If InGroup("Domain Users") Then
objNetwork.MapNetworkDrive "N:", "\\ACLHEATDB001\Heat Attachments"
Else
MsgBox("Call login script2")
Function InGroup(strGroupName)
Set objNetwork = CreateObject("WScript.Network")
strDomain = objNetwork.UserDomain
strUser = objNetwork.UserName
bIsMember = False
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUser & ",user")
For Each objGroup In objUser.Groups
If objGroup.Name = strGroupName Then
bIsMember = True
Exit For
End If
Next
InGroup = bIsMember
End Function]
Any assistance is greatly appreciated