Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Setting up network printer in Windows 7

28 Dec 2010   #21

W7 32
 
 

Chev65, yes those suggestions are valid, however as stated in the "to address other possible questions" post i made last, we have so many slow WAN links, that we don't want to run a centralized print server, which is what typical GPO based printer installs utilize. Setting up a local IP printer port on each machine to the local IP/network printers works faster, cuts down traffic on our already slow WAN links, and is not affected by a WAN link outage.

WindowsStar: the scripts are run via a domain based GPO that runs a unique computer startup script for each respective site's specific printers. I only have to assign a pc to it's site domain OU and it applies the startup script to that pc (effective at next restart that is).

the registry check is done by the script on each local machine. in XP anyways, each printer has a registry entry for the name of the printer, if you do a simple FIND | REG QUERY for that reg key, you'll either get a successful find which results in error level 0 which means the printer is already installed and the script skips on to the next loop and checks to see if the next printer in the list is installed. If a printer is not there, it proceeds with the cscript/prnport/printui scripting to install the printer.

the printer reg check from the script i posted originally:
FIND | REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\!P!"
IF ERRORLEVEL 1 (

so to answer your question, the registry check runs on the local machine to see if the desired printers are installed or not, if not, it installs them

My System SpecsSystem Spec
.

28 Dec 2010   #22

W7 32
 
 

to clarify the printer variable declaration part of the script:

SET P1=%AestheticNameOfPrinter (some name i want to call the printer, like CentralOffice-2
SET PIP1=%1x.x.x.x (the ip, requires the 1 at the beginning, can't remember why off hand)
SET PNAME1=%"TOSHIBA eS452/453Series PCL6" (the actual driver name of the printer, from inf file)
SET PDRIVER1=%"\\LocalSitePCname\PRINTERDRIVERS\352-353-452-453\eB4ox2.inf"(path to local driver share)
My System SpecsSystem Spec
28 Dec 2010   #23

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

@MattLieblong

Sorry to ask so many questions, I am trying to figure out if there is a better way to do this for you. We have been converting to Windows 7 from Windows XP and have found issues with the way printers were assigned via GPO and XP but we were able to work around them. When we started using Windows 7 we had a whole new set of issues. We tried deploying printers similar to how you have done, but had many many issues. Then we deployed them via other means and never had that work very well. Deploying printers with Windows Server 2008 R2 AD was not an option due to all the different Windows machines in the mix as well as many older special systems.

I wrote a custom script that works through GPO to deploy printers on Windows XP and Windows 7 as well as knowing the difference between 32bit and 64bit. The script I wrote will not work for you because you are not using print servers and we are. However I am looking at the script and seeing if it could be modified to be used in your type of setting.

What I was thinking due to your bandwidth limitations is using GPO for the unique settings for each location as well as the printer information. Then the script (universal) could be deployed as part of the logon script. Each machine would run the script; the script would check GPO for the printer settings and then add them.

I don't know if that is something you want to do or if you are willing to do a bunch of testing. Plus there would be a commitment on my side to work out all the bugs.

You would be able to create groups like:

Location 1
------------- Printer 1
------------- Printer 2
------------- Printer 3

Location 2
------------- Printer 1
------------- Printer 2

Location 3
------------- Printer 1
------------- Printer 2
------------- Printer 3
------------- Printer 4
------------- Printer 5

Then add computers to the group and they would get the printers assigned to the group. Or if you want to do it by AD usernames. You could simplify it by not caring about the locations and just creating the printer groups. Then if you wanted to add a printer across the WAN for one computer in another location you could do that without having to modify stuff or add the printer via some remote desktop manually. There are many ways to do this.

Maybe you have a better way or an ideal way you wish it could be done that can be done.

Let me know your thoughts. -WS
My System SpecsSystem Spec
.


29 Dec 2010   #24

W7 32
 
 

@WindowsStar
I'm open to any solution that is functional and manageable. We have only a couple actual support techs to cover over a thousand workstations and users. The previous printer script was a godsend to implement, and continues to save us dozens of man-hours a week. Actually, it doesn't really save us any time, it does dozens of hours of work we never had time to get to before.

Just to make sure the overall model is clear, the gpo aspect is utilized only to deploy a startup script. the printers themselves are not managed via gpo, or listed via gpo. the gpo only tells respective member OU pc's to run a specific script at startup.

I'm pretty close, i actually ran the xp script on a Windows 7 machine and it worked, installed the first printer in the script, but upon subsequent loops got hung up or threw 0x000006be errors. All i did to the Windows 7 machine was copy the prnport and other built in windows tools to the system32 folder.

I think at this point, i would like to try to tweak it to work on Windows 7 with the current design. Would rewriting my script in vbs or some other language open up any new functionalities over batch?
My System SpecsSystem Spec
29 Dec 2010   #25

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Quote   Quote: Originally Posted by MattLieblong View Post
@WindowsStar
I'm open to any solution that is functional and manageable. We have only a couple actual support techs to cover over a thousand workstations and users. The previous printer script was a godsend to implement, and continues to save us dozens of man-hours a week. Actually, it doesn't really save us any time, it does dozens of hours of work we never had time to get to before.

Just to make sure the overall model is clear, the gpo aspect is utilized only to deploy a startup script. the printers themselves are not managed via gpo, or listed via gpo. the gpo only tells respective member OU pc's to run a specific script at startup.

I'm pretty close, i actually ran the xp script on a Windows 7 machine and it worked, installed the first printer in the script, but upon subsequent loops got hung up or threw 0x000006be errors. All i did to the Windows 7 machine was copy the prnport and other built in windows tools to the system32 folder.

I think at this point, i would like to try to tweak it to work on Windows 7 with the current design. Would rewriting my script in vbs or some other language open up any new functionalities over batch?
If you are close then let's work on the current script. VBScripts give you access to WMI so almost anything can be done.
My System SpecsSystem Spec
24 Feb 2011   #26

W7 32 Ent.
 
 

Windows Star,
"If you have the printer shared off a server there is a much better way of doing this and I have a different script for that let me know."

Would this script work for setting a default printer for new users?
My System SpecsSystem Spec
27 Feb 2011   #27

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

@beebobby

I am not sure what you are asking me. I was helping the OP with printing. I was not the one in need of help.
My System SpecsSystem Spec
18 Oct 2011   #28

W7 32
 
 

Quote   Quote: Originally Posted by WindowsStar View Post
@MattLieblong

How do you deploy the scripts? Are the scripts on each machine? or are they stored somewhere? Is the registry key to tell you if they get a certain printer or to tell you which printers they get?

I use GPO's to deploy the printer-install startup scripts, respectively one for each WAN site I have. From the template I posted last year I created a custom script for each office that installs every network printer at each respective office. The script is manually managed, set via GPO to run at startup, and check the registry for the value of that unique printer name setup in the startup script. So it doesn't check for "dell printer" it checks for "OfficeName-Floor#-section".

So PC1 in officeA boots up, GPO tells it to run a script "PRNofficeA" which is stored on the Domain Controllers in the \\domain\netlogon folder. The batch script file does traverse the WAN link on each run, but only the script, no drivers. As the script runs, if a printer in the script is not installed(known by reg check), it then does a Printui.dll windows-based scripted install, which as many have described above, needs a printer Name, IP, Driver-specific device name, and the .inf driver file. The drivers are kept on a local machine at each office, and the script for each office lists the path to the inf driver file. The inf file then tells the printui.dll script which additional files to copy over (across the local switch), the driver installs, printer installs, and voila.

Then to change them down the road, there is a deletion trigger also within the printui.dll method. I don't even mess with updating drivers of existing printers, it's all local, so i just delete a printer, and recreate it.
My System SpecsSystem Spec
18 Oct 2011   #29

W7 32
 
 

I replied before I went and re-read the entire thread. Sorry if I repeated any explanations.

I figured out the problem in Windows 7, part of it I had already posted the solution to...Microsoft moved the Printui.dll script set to a subfolder (windows\system32\Admin_Printer_Scripts or something close). so you just need to adjust your scripts to call it from that new Windows 7 location. OR, if you are using all 32 bit or all 64 bit workstation OS's anyways, if you just copy the printui.dll set (7 files i believe) over to the XP-default location for them (windows\system32) then the same scripts will work on Windows 7 and XP (as long as all the pc's you run it against are the same OS bit rate).

The main issue in the testing I did a year ago, was that I was testing on a 64 bit Windows 7 box, and was trying to use 32 bit drivers. DOH! Got that resolved, we don't deploy any 64 Windows 7 boxes anyways, so as i described above, i'm able to continue using the same install scripts, just had to make sure the drivers it called during install were all 32 bit Windows 7 compatible.

Problem now, is that it seems MS moved the UnsignedDriverSucceed GPO option out of the machine side of group policy, over to the user side. I'm in the middle of finally deploying Windows 7's and have run into this. You'd be amazed how many drivers from major manufacturers websites are not signed, and thus cause these printer scripts as this this thread describes to fail.
My System SpecsSystem Spec
07 Feb 2012   #30

Windows 7
 
 

Quote   Quote: Originally Posted by WindowsStar View Post

Yep that page is confusing, but it does work, however it is a lot more work to use those commands then it is to just add the printer through the GUI.

Actually that page doesn't really describe how to add a network printer directly.
And believe me, spending an hour or two making a batch file is MUCH LESS WORK than doing the printer wizard 50+ times.
My System SpecsSystem Spec
Reply

 Setting up network printer in Windows 7




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:04 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33