Quantcast
Channel: Spiceworks Community
Viewing all articles
Browse latest Browse all 3098

VBS to map printer depending on security group and computer name

$
0
0

Excuse me if i have put this in the wrong area but i am looking to alter my printer vbs script so it maps a printer based on 2 variables - 1, the security group and 2, the computer name.

At the moment i have these 2 types of conditions:

The If statement which checks against the security group

If Instr(strGroups,*SecurityGroup*) then
wshnetwork.addwindowsPrinterConnection "\\server\printer1"
wshnetwork.addwindowsPrinterConnection "\\server\printer2"
wshnetwork.setdefaultprinter "\\server\printer1"
End If

and the Select Case statement which checks the computer name:

Select case (computername)
Case "*ComputerName*"
wshnetwork.addwindowsPrinterConnection "\\Server\Printer3"
wshnetwork.addwindowsPrinterConnection "\\Server\Printer4"
End Select

What i am wanting to do is to bring these 2 statements together so that if a user is a member of a specific...


Viewing all articles
Browse latest Browse all 3098

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>