×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Type Mismatch 'Join' in Logon Script

Type Mismatch 'Join' in Logon Script

Type Mismatch 'Join' in Logon Script

(OP)
Hi,

I'm using a simple Logon VBscript to map network drives and install printer based on domain security groups.  It executes pefectly fine while logging a domain admin in, but for a normal user, I get Type Mismatch 'Join' on line 17, char 1.  Here's the code...

Quote:


Dim net
Dim strGroups
Const ACCOUNTING_GROUP      = "cn=accounting"
Const BACKUP_GROUP          = "cn=backup"
Const OASIS_GROUP         = "cn=oasis"
Const SCHEDULE_GROUP        = "cn=schedule"
Const HARBORS_GROUP         = "cn=harbors"
Const PSP_GROUP            = "cn=psp"
Const ADMINISTRATORS_GROUP    = "cn=administrators"
Const HOSP_GROUP        = "cn=hosp"

Set wshNetwork = CreateObject("WScript.Network")
'disabled mapping for roaming profiles
'wshNetwork.MapNetworkDrive "H:", "\\server\Users$\" & wshNetwork.UserName

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

This sounds more like a domain security policy issue than a scripting issue, but thought I'd give it a shot...

Thanks!

RE: Type Mismatch 'Join' in Logon Script

(OP)
BTW, Line 17 is

Quote:


strGroups = LCase(Join(CurrentUser.MemberOf))

...seems pretty obvious, but thought I'd point directly to the problem.

RE: Type Mismatch 'Join' in Logon Script

And this ?
If IsArray(CurrentUser.MemberOf) Then
  strGroups = LCase(Join(CurrentUser.MemberOf))
Else
  strGroups = LCase(CurrentUser.MemberOf)
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

RE: Type Mismatch 'Join' in Logon Script

(OP)
@PHV

That seemed to do the trick!!  Thankyou much!

Saxis

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close