Active Directory

I have been working with Active Directory today. I am writing some VBScript code that will automatically login a user to our Learning Management System using their Windows login managed by Active Directory. I needed to find all of the groups that a user belongs to. The LMS uses these groups to make course assignments. I found some excellent code examples from Richard Mueller. The samples help you see that ADSI (the library used to access Active Directory and other things) uses two different methods to get the user’s primary group and other groups.

I ran into one problem when getting the list of groups with VBScript. The memberof function usually returns a collection. However, this collection will be empty if ther user does not belong to any groups. In VbScript, you need to use the IsNull() function to see if a collection is empty. All of the ADSI examples that I found on the web used IsEmpty() – a function that will work fine in VB but will not work correctly in VBScript.

About Leo Lucas

Leo Lucas is an e-learning consultant. Leo has 25 years of experience developing e-learning programs, authoring tools and learning management systems. Over the years, he has created e-learning solutions for large and small clients. Prior to founding e-Learning Consulting, Leo served in several senior management roles at Click2learn (now SumTotal Systems) including Vice President of Product Marketing and Vice President of Product Development. While at Click2learn, Leo led the development of the e-learning authoring tools and learning management systems. Leo served as Vice President of Engineering and Chief Technical Officer at Aimtech Corporation. Leo's team created the first Windows-based multimedia authoring system and other award winning software running on Windows, Unix and other operating systems. Leo started his e-learning career by creating and leading the first computer based learning development team within the US Army Intelligence School at Fort Devens.
This entry was posted in LDAP, VBScript. Bookmark the permalink.

Comments are closed.