Windows Server 2003 Domain & Printer Question

AMD_RULES

2[H]4U
Joined
Mar 26, 2007
Messages
3,010
Is there anyway to have a network printer automatically installed for each user onto on the domain so that they do not have to go to "add printer" each time they log onto a different computer?

Thanks!
 
Or you can just do a simple .bat file and assign it via GPO or to individual users in AD:


rundll32 printui.dll,PrintUIEntry /in /n \\SERVER\Printer1
 
The printing features of R2 suck.

I have tried many different methods of doing this, and the one that works by far the best is by using a VBScript pushed out through a group policy. It is very reliable and easy to setup/administer. You don't have to know any vbscript for it to work. Here's an example:

=====Start=====
Option Explicit
On Error Resume Next
Dim objNetwork, objSysInfo, strUserDN
Dim objGroupList, objUser, objFSO
Dim strComputerDN, objComputer
Dim strComputerName
Set objNetwork = CreateObject("Wscript.Network")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject("ADSystemInfo")
strUserDN = objSysInfo.userName
strComputerDN = objSysInfo.computerName
strComputerName = objNetwork.ComputerName
' Bind to the user and computer objects with the LDAP provider.
Set objUser = GetObject("LDAP://" & strUserDN)
Set objComputer = GetObject("LDAP://" & strComputerDN)

If InStr(strComputerName, "PC1") > 0 Then
objNetwork.AddWindowsPrinterConnection "\\PC99\HP-4250"
objNetwork.AddWindowsPrinterConnection "\\PC99\HP-960c"
objNetwork.SetDefaultPrinter "\\PC99\HP-4250"
End If
' Clean up.
Set objNetwork = Nothing
Set objFSO = Nothing
Set objSysInfo = Nothing
Set objGroupList = Nothing
Set objUser = Nothing
Set objComputer = Nothing
=====End=====


So if the computername is PC1, it will add these two network printers, and make the 4250 the default printer.

You copy this text, paste it into a notepad file. After you've modified and saved it, rename to a .vbs.

Now you create a new group policy script, and under User Configuration, Windows Settings, add a logon script, and copy this .vbs file into it.

There's also a method where you can use computer groups instead of computer names, if your naming scheme is inconsistent.
 
Agreed, but it's a choice. I use a vbscript myself as well. I have a very good naming system, for labs and locations, so it works out quite well.

I'll share my script. You'd just have to change how much of the computer name it checks to fit in with your naming convention. Then, just more If Then statements for each location. Or you can switch it over to Case.

Code:
On Error Resume Next

Dim objNetwork, strComputerName, strFirstEight

Set objNetwork = CreateObject("WScript.Network")
strComputerName = objNetwork.ComputerName
strFirstEight = Left(strComputerName,8)

If strFirstEight = "XX-XX-XX" Then
    objNetwork.AddWindowsPrinterConnection "\\server\printer"
    objNetwork.SetDefaultPrinter "\\server\printer"
End If

Set objNetwork = Nothing
Set strComputerName = Nothing
Set strFirstEight = Nothing
 
Back
Top