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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch 'Join' in Logon Script

Status
Not open for further replies.

Saxis

IS-IT--Management
Joined
Sep 29, 2005
Messages
3
Location
US
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...

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!
 
BTW, Line 17 is
strGroups = LCase(Join(CurrentUser.MemberOf))

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

 
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
 
@PHV

That seemed to do the trick!! Thankyou much!

Saxis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top