All Forums >> [Scripting] >> WSH & Client Side VBScript >> Question: Need help with an If statement to determine group membership Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Hey everyone, Thanks for the help with my last question regarding what certain lines of code did. My new question is a little more complicated.
I'm writing a logon script that first deletes any existing network drives or printers and then maps drives and printers based on the users groups.
So far I've got it deleting the printer but now I'm trying to write and If Then statement to determine the users group and its causing me problems.
What I would like is to have a script that does something like this:
Below is my entire script to this point. I'm not exactly certain what would be the most efficient way to go about doing this, as there are users who are members of multiple groups that need to be checked for. Any and all scripting wisdom is welcome as I'd like to make this script as fast and efficient as possible.
Nope, we seem to be group happy at this company. So like myself, I am a member of Support Users I.T. Staff All Employees etc. (a few more redudant ones)
My manager is a member of all those groups as well in addition to an office manager group.
For Each Group In TheListOfAllGroupTheUserBelongsTo Select Case Group Case GroupX Map drive T: Map drive U: <------- Map drive V: Set Printer X as default Case GroupY Map drive U: <------ Map drive V: Set Printer Y as default Case GroupZ etc Case Else Diagnostics/Error: Group not accounted for End Select Next