If you are using Windows 2003 as a domain controller, you need to create a login script that is processed each time the use logs in.
this batch or vbscript file is placed in %SystemRoot%\sysvol\sysvol\domainname.com\scripts
A sample batch file might look like this:
@ECHO OFF
REM - this line deletes any current mapped
REM printers in case there is a change in
REM network settings
if exist lpt3 net use lpt3 /delete
REM - this line maps lpt3 to the network
REM printer
net use lpt3 \\server_name\printer_name
A sample vbscript file might contain:
dim oPort
dim oMaster
set oPort = CreateObject("Port.Port.1")
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
oPort.PortType = 3
oPort.PortName = "\\server_name\printer_name"
oMaster.PortAdd oPort
if Err <> 0 then
msgbox "There was an error creating the port."
end if
These scripts can also be placed in the Group Policy Framework if you need certain users/groups to map to specific printers.
- Philip