Adding Network printer to Windows 7 with Powershell
I found some code for adding a network printer from my server with Powershell.  It works great however I am prompted to install the driver.  "Do you trust this printer?" "windows needs to download and install a software driver from the \\servername computer to print to (printers shared name). Proceed only if you trust the \\servername computer and the network.  My options are Install driver and Cancel.  Is there a way to always install the printer from the server and never prompt the user?

Code:

$PrinterPath = "\\SERVERNAME\PRINTER_SHARE_NAME"
$net = new-Object -com WScript.Network
$net.AddWindowsPrinterConnection($PrinterPath
February 26th, 2010 8:12pm

I had to deploy printers in a Pure Vista network.  I found Using Group Policy HANDS DOWN was the best method.  I do believe for some legacy drivers I had to adjust permissions to allow users to install drivers (Because the drivers weren't up to spec) but I didn't use vbScript.

The nice part if you use Group Policy and apply it to the Computer Configuration, the printers populate in the background and the login script (or login process is FAR faster).  Also doesn't chew up the bandwidth in a nasty way.

Settings for printers in Group Policy are under

"Policies/Windows Settings/Deployed Printers"

Hope this helps.  I live for Powershell but somethings make sense to use other methods :)

Sean
The Energized Tech
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2010 9:35pm

My DCs are Windows Server 2003.  I am not seeing the option in Group Policy Management to do the setting you suggested.  I can see it in my Group Policy Management Editor for my Windows 7 PC but not on the Server.

I wrote a script for XP which works fine and installs all the printers I need.  However I am trying to test it in Windows 7 (using Powershell) and that dialog box prompts me for input. I don't know how to disable that popup or enter the select "install driver" option.  I am sure I will have issues dealing with "Are you sure you want to do this?" type dialogs in the future and would be nice to know how to get around that right now...

Thanks for your help!
February 26th, 2010 10:03pm

Hi Dustin,

It's possible that the Get-ExecutionPolicy is not configured. Let me know if this helps.

http://technet.microsoft.com/en-us/library/ee176949.aspx

 

Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2010 10:06pm

I can install a local printer this way, but I need to install a shared printer from a print server.  I don't see that option under this.  I only see it under the user which really slows down login.
May 21st, 2010 8:09pm

Try implementing this and see if this helps: http://thisishelpful.com/fix-shared-printer-need-install-printer-driver.html

This seems to happen when the driver isn't on the computer so needs to download it first time. Either that or your users don't have admin rights on their computesr to install the printer drivers.

Hope that helps.

Free Windows Admin Tool Kit Click here and download it now
May 29th, 2011 10:14pm

Use the Win 7 machine to create the GPO. There is no need to create on the server. The Win 7 GPO will be applied the same. I have a Win 2003 environment and I am deploying Group Policy Preferences without issue using this method.
May 30th, 2011 2:55am

Thanks Sean. this makes things easier, much mor easier than Powershell scripting for clients using Windows 7.
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 4:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics