Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Script Error (Type Mismatch: Join)

Status
Not open for further replies.

precioustony

Technical User
Jun 23, 2004
46
GB
I have this script that I want to use in mapping drives and printers but it is giving me errors. It runs well when am logged in as an administrator but with an ordinary domain user account it generates errors and of course I cannot give users admin rights. the error generated is:

Type mismatch: 'Join'
Code: 800A000D

Here is the full VBScript:

'===========================================================
Option Explicit
Dim server
Dim drive
Dim wshNet
Dim ADSysInfo
Dim CurrentUser
Dim strGroups
Dim GroupMember
Dim a

Const SYSTEMS = "cn=colsystems"

server = "\\server1"
drive = "\\server1\test1"
Set wshNet = CreateObject("WScript.Network")

Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

Select Case GroupMember
case a = InStr(strGroups, SYSTEMS)
Systemssub

End Select

Sub Systemssub
wshNet.MapNetworkDrive "f:","\\server1\test2"
wshNet.AddWindowsPrinterConnection "\\server1\hp"
wshNet.SetDefaultPrinter "\\server1\hp"
End Sub

WScript.Echo("Script completed successfully")

WScript.Quit
---
 
Are you getting a line number, and a character number as well?

Have you ensured that the domain users have permissions to the "assigned" resources?

Have you asked the very smart guys in the VBScript forum?

forum329
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top