Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Login Script - Join Function

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,965
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Login Script - Join Function
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Login Script - Join Function - 2/1/2004 11:59:42 PM   
  hockey2389

 

Posts: 1
Score: 0
Joined: 2/1/2004
From:
Status: offline
I have a login script for a windos 2000 Domain that maps drives based on group membership. It works fine until the user is a memeber of ALL 3 groups in the script, then I get a Type Mismatch on the Join function. The code is below, thanks in advance for your help!

Dim wshNetwork, ADSysInfo, CurrentUser

Set wshNetwork = CreateObject("WScript.Network")
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)

strGroups = LCase(Join(CurrentUser.MemberOf))

wshNetwork.MapNetworkDrive "S:","\\mmsvr1\shared$"

'wshNetwork.AddWindowsPrinterConnection"\\mmsrv1\Printer"
'wshNetwork.SetDefaultPrinter"\\mmsvr1\Printer"

If InStr(strGroups, "cn=shopkey") Then
wshNetwork.MapNetworkDrive "R:","\\mmsvr1\shopkey$"
End If

If InStr(strGroups, "cn=quicken") Then
wshNetwork.MapNetworkDrive "Q:","\\mmsvr1\quicken$"
End If

If InStr(strGroups, "cn=tracker") Then
wshNetwork.MapNetworkDrive "T:","\\mmsvr1\tracker$"
End If


Set wshNetwork = Nothing
Set ADSysinfo = Nothing
Set CurrentUser = Nothing
 
 
Post #: 1
 
 Re: Login Script - Join Function - 3/3/2004 8:27:01 AM   
  sflanders

 

Posts: 1
Score: 0
Joined: 3/3/2004
From: USA
Status: offline
I'm not sure why the Join function does't like the 'CurrentUser.MemberOf' object array. You might want to test the array before passing it to the Join function...

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

(in reply to hockey2389)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Login Script - Join Function Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts