Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Map  a  Printer  Based  on  the  Computers  OU  

 Content of Map a Printer Based on the Computers OU.vbs
MD5 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 ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a