Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Map a Printer Based on the Computers OUContent of Map a Printer Based on the Computers OU.vbsMD5 Hash: 7DD26BF5A0AE3924725D04B1040F0A9A |
||
Set objSysInfo = CreateObject("ADSystemInfo")
strName = objSysInfo.ComputerName arrComputerName = Split(strName, ",") arrOU = Split(arrComputerName(1), "=") strComputerOU = arrOU(1) Set objNetwork = CreateObject("WScript.Network") Select Case strComputerOU Case "Client" objNetwork.AddWindowsPrinterConnection "\\PrintServer1\ClientPrinter" objNetwork.SetDefaultPrinter "\\PrintServer1\ClientPrinter" Case "Finance" objNetwork.AddWindowsPrinterConnection "\\PrintServer2\FinancePrinter" objNetwork.SetDefaultPrinter "\\PrintServer2\FinancePrinter" Case "Human Resources" objNetwork.AddWindowsPrinterConnection "\\PrintServer3\HRPrinter" objNetwork.SetDefaultPrinter "\\PrintServer3\HRPrinter" Case "Research" objNetwork.AddWindowsPrinterConnection "\\PrintServer4\ResearchPrinter" objNetwork.SetDefaultPrinter "\\PrintServer4\ResearchPrinter" Case Else objNetwork.AddWindowsPrinterConnection "\\PrintServer5\GenericPrinter" objNetwork.SetDefaultPrinter "\\PrintServer5\GenericPrinter" End Select | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |