Jump to content

Printers via script in Windows 7 not mapping


Recommended Posts

Posted

Hi! I`m having a problem mapping printers via script in my network. I have three domain controllers: primary 2008, sec 2008 R2 and third 2003 R2.

We are currently mapping our printers via script as below:

 

rundll32 printui.dll PrintUIEntry /in /ga /n \\printserver\A203Pntr

 

We have it for all printers we got. It works perfectly fine with XP but not does not map printers in Win 7 (currently +-110 machines). I have disabled UAC, I have tried few registry fixes as well:

 

1.

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]

"lmcompatibilitylevel"=dword:00000002

 

2.

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]

"ConsentPromptBehaviorAdmin"=dword:00000000

"ConsentPromptBehaviorUser"=dword:00000003

"EnableInstallerDetection"=dword:00000001

"EnableLUA"=dword:00000000

"EnableSecureUIAPaths"=dword:00000001

"EnableUIADesktopToggle"=dword:00000000

"EnableVirtualization"=dword:00000001

"PromptOnSecureDesktop"=dword:00000000

"ValidateAdminCodeSignatures"=dword:00000000

"dontdisplaylastusername"=dword:00000000

"legalnoticecaption"=""

"legalnoticetext"=""

"scforceoption"=dword:00000000

"shutdownwithoutlogon"=dword:00000001

"undockwithoutlogon"=dword:00000001

"FilterAdministratorToken"=dword:00000000

"EnableLinkedConnections"=dword:00000001

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\UIPI]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\UIPI\Clipboard]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\UIPI\Clipboard\ExceptionFormats]

"CF_TEXT"=dword:00000001

"CF_BITMAP"=dword:00000002

"CF_OEMTEXT"=dword:00000007

"CF_DIB"=dword:00000008

"CF_PALETTE"=dword:00000009

"CF_UNICODETEXT"=dword:0000000d

"CF_DIBV5"=dword:00000011

 

In some cases I`m able to see the printer, some printers does not map at all,

Has any of you have similar problem when migrating to Win 7?

Posted
ive found script for printers on win7 arent worth the effort i deploy them via group policy (available from 2003 r2 server inwards)
Posted

You can use powershell

$PrinterPath = "\\machine\printer"
([wmiclass]"Win32_Printer").AddPrinterConnection($PrinterPath)

 

or

$PrinterPath = "\\machine\printer"
(New-Object -ComObject WScript.Network).AddWindowsPrinterConnection($PrinterPath)

Posted

We added a logon script with a loopback policy for example:

 

		Set WshNetwork = CreateObject("Wscript.network")
	PrinterPath1 = "\\srv-print-a\IT1-HP3525MONO"
	PrinterPath2 = "\\srv-print-a\IT1-HP3525nCOLOUR"
	PrinterDriver1 = "HP LaserJet 3525 Black"
	PrinterDriver2 = "HP LaserJet 3525 Colour"
	Wshnetwork.addwindowsprinterconnection Printerpath1, Printerdriver1
	Wshnetwork.addwindowsprinterconnection Printerpath2, Printerdriver2
	Wshnetwork.setdefaultprinter "\\srv-print-a\IT1-HP3525MONO"

 

PCL5 drivers appear to work best and we also enabled the following group policy as non signed drivers would not work without.

 

Computer Config/Policies/Admin Templates/Printers/Point and Print Restrictions setting is disabled.

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...