|
All of the printers at our remote
locations are in different parts of their building, management wants all setups
to be transparent to the user.� I could do this PC by PC, but Logon seemed
easier. The space isn’t in my actual script,
guess it happened while I was sanitizing it J.� Thank you for the help
that was exactly what I needed.� You are a life saver. Thanks,
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of deji Agba For Each the Computer In aryP1 If UCASE(theComputer) = UCASE(strComputer)
Then
Printer1 End If Next I wonder why you have to put this in an array and do it
this way. But then, you understand your requirement and setup better. Also, are
the spaces "\\Local_Print_Server
\P1 " and other just typos or intentional? Sincerely, Microsoft MVP - Active Directory From: Raymond
McClinnis 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
- [ActiveDir] OT: Logon-Script Help Raymond McClinnis
- RE: [ActiveDir] OT: Logon-Script Help deji Agba
- RE: [ActiveDir] Kerberos event ID'... 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
