kellyexch
asked on
Add Port, Delete Port and Assign Port to printer ( script please)
I need to achieve the following A.S.A.P
I need a script for the following:
Add 60 TCP/IP printer port
Assign in the new TCP/IP Ports to 60 printers
Delete 60 TCP/IP printer port
This is a windows 2000 environment.
Thanks.
I need a script for the following:
Add 60 TCP/IP printer port
Assign in the new TCP/IP Ports to 60 printers
Delete 60 TCP/IP printer port
This is a windows 2000 environment.
Thanks.
What I also want to say.. LPT ports are best used when working with some older programs and sertenly on OLD DOS programs since most of them do not know other print ports..
You also can use this script(VBS) but its long, hard to read and the BAT script posted above do the same thing:
Map a network printer by using the Windows Scripting Host (WSH) to run a Visual Basic script:
Set WshNetwork = CreateObject("WScript.Netw ork")
PrinterPath = "\\YourServer\YourPrinterS hare"
PrinterDriver = "YourPrinterDriver"
WshNetwork.AddWindowsPrint erConnecti on PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrint er "\\YourServer\YourPrinterS hare"
NOTE: YourPrinterDriver must exactly match the driver name in the Ntprint.inf file.
If you wish to add a different printer for each user who logs on to Terminal Services:
Set WshNetwork = CreateObject("WScript.Netw ork")
Select Case WshNetWork.UserName
Case "Username1"
PrinterPath = "\\YourServer\YourPrinterS hare1"
PrinterDriver = "YourPrinterDriver1"
WshNetwork.AddWindowsPrint erConnecti on PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrint er "\\YourServer\YourPrinterS hare1"
Case "Username2"
PrinterPath = "\\YourServer\YourPrinterS hare2"
PrinterDriver = "YourPrinterDriver2"
WshNetwork.AddWindowsPrint erConnecti on PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrint er "\\YourServer\YourPrinterS hare2"
End Select
Using a logon script or Group Policy, run the script each time a user logs on to the client
You also can use this script(VBS) but its long, hard to read and the BAT script posted above do the same thing:
Map a network printer by using the Windows Scripting Host (WSH) to run a Visual Basic script:
Set WshNetwork = CreateObject("WScript.Netw
PrinterPath = "\\YourServer\YourPrinterS
PrinterDriver = "YourPrinterDriver"
WshNetwork.AddWindowsPrint
WshNetwork.SetDefaultPrint
NOTE: YourPrinterDriver must exactly match the driver name in the Ntprint.inf file.
If you wish to add a different printer for each user who logs on to Terminal Services:
Set WshNetwork = CreateObject("WScript.Netw
Select Case WshNetWork.UserName
Case "Username1"
PrinterPath = "\\YourServer\YourPrinterS
PrinterDriver = "YourPrinterDriver1"
WshNetwork.AddWindowsPrint
WshNetwork.SetDefaultPrint
Case "Username2"
PrinterPath = "\\YourServer\YourPrinterS
PrinterDriver = "YourPrinterDriver2"
WshNetwork.AddWindowsPrint
WshNetwork.SetDefaultPrint
End Select
Using a logon script or Group Policy, run the script each time a user logs on to the client
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
TheLearnedOne ,
I have a comment :)
What about the points? I did try to help and I'm sure that the solutions posted in here are adequate for solving the questioners problem.
Regards,
Rikke
I have a comment :)
What about the points? I did try to help and I'm sure that the solutions posted in here are adequate for solving the questioners problem.
Regards,
Rikke
Install printer on printserver on IP_192.168.1.10 port
Share the printer on the server
The thing I would try next is
make a batch for logon
@echo off
net use lpt1: /delete (delete the device on Local Print Port if exists)
net use lpt1: \\printserver\printer /persistent: YES (add printer and keep this printer persistent)
make a batch for logoff
@echo off
net use lpt1: /delete (delete the printer since workstation can be used by a next user that is not allowed to print on network printer)
put this logon script in your netlogon share of the Y2K AD environment. After that open the OU (Organisational Unit) from all your users (top level OU). Open your GPO that is in here or add a GPO.
In your GPO table so to user configuration -> windows environment -> logon/logoff..
Add the logon.bat in the logon section.
Add the logoff.bat in the logoff section.
This should be enough to work.
Keep me posted
Rikke