Brian Madden Logo
Your independent source for application and desktop virtualization.
advertisement

VBS Script to determine group/sub-group membership, in the Scripting / Automation forum on BrianMadden.com

rated by 0 users
This post has 2 Replies | 1 Follower

Top 10 Contributor
Points 48,501
Dan Murray Posted: Mon, Dec 22 2008 11:30 AM

I've got a requirement for a script that runs at logon that checks for a user's membership in a group.  The problem with the script I use now is that it does not take into account the fact that a user might be a member of a group WITHIN the group that I'm checking for.  As an example, the group I want to check for might be "CitrixApplications".  Within that group I might have other groups listed (eg. "Accounting","Purchasing", etc.).  The user might be in the "Accounting" group, but when I check the user's AD group membership, they don't show up as a member of "CitrixApplications".  Is there an easy way to check a group for a specific user, even if the user is in a nested group?

Thanks in advance!

Dan

Why is it called "Common Sense"? It doesn't seem all that common!

  • | Post Points: 20
Not Ranked
Points 70
miks replied on Tue, Dec 23 2008 9:04 AM

the scripts from Richard Mueller at  www.rlmueller.net

can help you

 

vbscript functions to test for group membership

http://www.rlmueller.net/freecode1.htm

 

 

  • | Post Points: 20
Top 10 Contributor
Points 48,501

Perfect!  IfMember #7 did the trick.  I'd found some other code, but if the user WASN'T in the top-level group, it took too long for the script to run.  The code you suggested was much faster.  Thank you!

Why is it called "Common Sense"? It doesn't seem all that common!

  • | Post Points: 8
Page 1 of 1 (3 items) | RSS