Hello. I have a generic script that maps all printer (15 total) but want to make it more specific so groups only get the printers they need.
I am stuck thinking in terms of "goto" which VBS doesn't support. How would I do the following?
If user group = "HR" then goto Print1
If user group = "RD" then goto Print2
If user group = "Sales" then goto Print3
Print 1
WshNetwork.RemovePrinterConnection "\\HP-FPS\HR_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\HR_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\HR_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\HR_Copier", True
Goto End
Print2
WshNetwork.RemovePrinterConnection "\\HP-FPS\RD_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\RD_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\RD_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\RD_Copier", True
Goto End
Print 3
WshNetwork.RemovePrinterConnection "\\HP-FPS\Sales_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\Sales_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\Sales_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\Sales_Copier", True
End
Thanks for your assitance.
I am stuck thinking in terms of "goto" which VBS doesn't support. How would I do the following?
If user group = "HR" then goto Print1
If user group = "RD" then goto Print2
If user group = "Sales" then goto Print3
Print 1
WshNetwork.RemovePrinterConnection "\\HP-FPS\HR_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\HR_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\HR_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\HR_Copier", True
Goto End
Print2
WshNetwork.RemovePrinterConnection "\\HP-FPS\RD_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\RD_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\RD_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\RD_Copier", True
Goto End
Print 3
WshNetwork.RemovePrinterConnection "\\HP-FPS\Sales_printer", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\Sales_printer", True
WshNetwork.RemovePrinterConnection "\\HP-FPS\Sales_Copier", True
WshNetwork.AddWindowsPrinterConnection "\\HP-FPS\Sales_Copier", True
End
Thanks for your assitance.