Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


[SOLVED]Logon script for Active directory. code not working

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> [SOLVED]Logon script for Active directory. code not working
  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 >>
 [SOLVED]Logon script for Active directory. code not wor... - 1/9/2008 6:09:25 AM   
  enmi

 

Posts: 5
Score: 0
Joined: 1/9/2008
Status: offline
Hi! i have trouble with the following logon script. when i run it it complains about the "strGroups = LCase(Join(CurrentUser.MemberOf))" Line, im not in front of the server right now so i cant give you the exact error message. But after i broke the script down a bit i realized that it could be the fact that my users is in an Organizational unit, and that the group policy is applied for the whole domain. So what would be the correct way to fix this? move the group policy and apply it for the OU or change the logon script? the script here is a copy that i got from microsofts pages, so hopefully its correct. Hope you can point me in the right direction

(Ofcourse i have setup the needed groups)



      

< Message edited by enmi -- 1/10/2008 1:17:23 AM >
 
 
Post #: 1
 
 RE: Logon script for Active directory. code not working - 1/9/2008 6:16:08 AM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Could it be the user is only part of "Domain Users" and one other group?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to enmi)
 
 
Post #: 2
 
 RE: Logon script for Active directory. code not working - 1/9/2008 6:18:48 AM   
  enmi

 

Posts: 5
Score: 0
Joined: 1/9/2008
Status: offline
hmm well the user is member of domain users and the "engineering" group do you have any suggestion which more groups he should be member of?

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: Logon script for Active directory. code not working - 1/9/2008 6:22:26 AM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
MemberOf will not see the default group which is probably "Domain Users"....this only leaves this other group....so it will not be seen as an array, but a string

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

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to enmi)
 
 
Post #: 4
 
 RE: Logon script for Active directory. code not working - 1/9/2008 6:25:36 AM   
  enmi

 

Posts: 5
Score: 0
Joined: 1/9/2008
Status: offline
To bad im not at the server right now its 20:30 so the company is closed. I'll have to check tomorrow and then i can post an update...

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: Logon script for Active directory. code not working - 1/9/2008 9:29:30 PM   
  enmi

 

Posts: 5
Score: 0
Joined: 1/9/2008
Status: offline
Okey, have tested it now, but get "Incompatible types: 'Join'   (translated from swedish) maybe its easier if i explain my current layout and we make a new script?

The AD domain is "kyat.local" and under that i have a OU called "kyat06" and in the OU i have the users..

kyat.local
     |
     |---users
     |---kyat06
               |------OP_1
               |------AD_1
               |------TK_1

I have three shares configured for three global security groups: "administration,produktion,teknik"

I want to map the users to the different shares based on their security group.

If i login with the user "OP_1" which is member of "produktion" i want to map X: to \\kyat-1\produktion\

Any ideas?..

(in reply to enmi)
 
 
Post #: 6
 
 RE: Logon script for Active directory. code not working - 1/10/2008 1:17:00 AM   
  enmi

 

Posts: 5
Score: 0
Joined: 1/9/2008
Status: offline
Solved this problem with this script: http://lazynetworkadmin.com/content/view/7/6/

(in reply to enmi)
 
 
Post #: 7
 
 
 
  

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 >> [SOLVED]Logon script for Active directory. code not working 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