Jump to content

Recommended Posts

Posted

I'm tearing my hair out over this one as it used to work reliably and now doesn't, I've tried 4 different methods of scripting network printer connections but none of them seem to work 100%.

 

I can't use PaperCut Print Deploy because it doesn't support deploying printers based on Active Directory properties of the computer. Same for Group Policy Preferences.

 

I have tried:

 

  • objNetwork.AddWindowsPrinterConnection \\PRINTSERVERNAME\PRINTQUEUE
  • cscript.exe %windir%\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -ac -p \\PRINTSERVERNAME\PRINTQUEUE
  • rundll32 printui.dll,PrintUIEntry /in /q /n \\PRINTSERVERNAME\PRINTQUEUE
  • objShell.Run "%SystemRoot%\explorer.exe \\PRINTSERVERNAME\PRINTQUEUE", 0, True

 

Can anyone suggest any other more reliable ways to deploy printers?

 

It's not the PrintNightmare stuff as that would mean it wouldn't work at all, what is happening is it is randomly deploying some of the printers and not others.

Posted

$printers = Get-Printer -Computername server.local

$server = "\\server.local"

ForEach ($printer in $printers) {

$printermap = $server + $printer.name

Invoke-Expression 'rundll32 printui.dll PrintUIEntry /ga /in /q /n $($printermap)'

}

Posted

Use GPP with a shared printer then use loopback processing in a policy covering a OU where the computer that you want to get the printer is. Make sure you select the appropriate mode i.e. Merge or the other one which I cannot remember.

 

What printers are you using by the way.

 

Apologies if you have tried loopback processing already.

  • Thanks 1
Posted
In the end I have got it working using the prnmngr.vbs method and then afterwards checking Wscript.Network.EnumPrinterConnections to make sure the printer actually got added.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...