|
Hi All; I’m trying to set up each computer
at my remote locations to use a specific Default Printer (also needs to be
mapped to LPT3: ) using an array. I used IF…THEN…ELSEIF, but
it required more coding than I really wanted to do (but it worked fine).
After I put the Arrays in place no matter what the Computer Name it always
executes Sub Printer1 and ignores Sub Printer2. I’m pretty sure I’m
missing a call to the obj.Network.ComputerName or something, I’m just not
sure where to put it Any help will be greatly appreciated. Thanks in Advance, Raymond McClinnis Begin
Script: Set objNetwork =
CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName strUser = objNetwork.Username aryP1 = Array("COMPUTER1",
" COMPUTER2", " COMPUTER3", " COMPUTER4") aryP2 = Array("COMPUTER5",
" COMPUTER6", " COMPUTER7", " COMPUTER8", " COMPUTER9") 'Logon script start ' Mapping ALL LOCAL Network Printers objNetwork.AddWindowsPrinterConnection
"\\Local_Print_Server \P1 " objNetwork.AddWindowsPrinterConnection
"\\Local_Print_Server \P2" ‘objNetwork.AddWindowsPrinterConnection
"\\Remote_Print_Server \P1" ‘objNetwork.AddWindowsPrinterConnection
"\\Remote_Print_Server \P2" '--==In the event of \\Local_Print_Server
Hardware failure, remove the ' from in front of \\Remote_Print_Server==-- '--==And put them in front of \\Local_Print_Server
==-- ' Setting Default Printers by DEV# For Each objNetwork.ComputerName In aryP1 Printer1 Next For Each objNetwork.ComputerName In aryP2 Printer2 Next wscript.echo "Your logon to is
Complete. Thank You, Have A Nice Day!" wscript.Quit Sub Printer1 objNetwork.AddPrinterConnection
"LPT3:", “\\Local_Print_Server\P1" objNetwork.SetDefaultPrinter
“\\\\Remote_Print_Server\P1” ‘ objNetwork.AddPrinterConnection
"LPT3:", “\\Remote_Print_Server\P1" ‘ objNetwork.SetDefaultPrinter
“\\Remote_Print_Server\P1” '--==In the event of \\Local_Print_Server
Hardware failure, remove the ' from in front of \\Remote_Print_Server==-- '--==And put them in front of \\Local_Print_Server
==-- End Sub Sub Printer2 objNetwork.AddPrinterConnection
"LPT3:", “\\Local_Print_Server\P2" objNetwork.SetDefaultPrinter
“\\Local_Print_Server\P2” ‘ objNetwork.AddPrinterConnection
"LPT3:", “\\Remote_Print_Server\P2" ‘ objNetwork.SetDefaultPrinter
“\\Remote_Print_Server\P2” '--==In the event of \\Local_Print_Server
Hardware failure, remove the ' from in front of \\Remote_Print_Server==-- '--==And put them in front of \\Local_Print_Server
==-- End Sub |
- [ActiveDir] Kerberos event ID's 677 Fuller, Stuart
- [ActiveDir] Domain clients hangs before logon,... J0mb
- RE: [ActiveDir] Kerberos event ID's 677 Eric Fleischman
- RE: [ActiveDir] Kerberos event ID's 677 joe
- RE: [ActiveDir] OT: Logon-Script Help Raymond McClinnis
- RE: [ActiveDir] OT: Logon-Script Help deji Agba
- RE: [ActiveDir] OT: Logon-Script H... Raymond McClinnis
- RE: [ActiveDir] Kerberos event ID's 677 Eric Fleischman
- RE: [ActiveDir] Kerberos event ID's 677 Myrick, Todd (NIH/CIT)
- RE: [ActiveDir] Kerberos event ID's 677 Fuller, Stuart
- RE: [ActiveDir] Kerberos event ID's 677 Eric Fleischman
