VMware Horizon Community
elproductoONE
Contributor
Contributor

Mapping TCP Printers

I am having some issue with setting up TCP printers in UEM.  I wanted to ask the community what approach would ensure TCP printers are setup for UEM end users upon logon.  I tried an approach that worked initially with my test AD account but failed with a production AD account.  I provide detail on this approach below.

I figured adding printers would be simple in UEM, however UEM only maps shared printers natively.  As an alternate approach, I created a batch script to map tcp/ip ports and printers which I embed in the AppData folder using the UEM File & Folders feature.  I embed this script one folder into the template Appdata folder that is represented in UEM.  The script ends up in “%HOMEPATH%\AppData\Roaming\BusinessPrinters\BizPrinters.bat”.  This script below is called as part of Logon task in UEM. I made sure script was copied before profile import and script is run after profile import. However when I check the printer with prod AD account no printer have been mapped.

Script Content

cscript c:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r IP_10.216.40.191 -h 10.216.40.191

cscript "c:\Windows\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs" -a -p “BizPrinter” -m "RICOH MP 4054 PCL 6" -r IP_10.216.40.191

2 Replies
elproductoONE
Contributor
Contributor

Figured out what the issue was.  The variable %HOMEPATH%  was not the variable I should have used.  As a workaround I have placed the script on end users desktop via File and Folder UEM section and used command "%userprofile%\Desktop\BizPrinters.bat" in a Logon Task to map the TCP/IP printers.  Alternatively one could input the command to map printer in the Logon Task, but I am not sure the order of Logon Tasks so I opted to call the printer mapping script instead. 

elproductoONE
Contributor
Contributor

I have a quick update.  Mapping a printer this way, will leave the printer and port on the VM if no corrective action is taken to remove them.  In addition printer added this way will become the default printer for next end user of VM printer was mapped on.  I am exploring another option mentioned in this forum linked below, but it does not seem to be working with directly mapped TCP/IP printers, plus it captures all UEM mapped printer, and user mapped printer .  For peace of mind I would recommend you add printer needed to a print server, as UEM support print queues natively.

I would recommend a task to unmap any printer added using this method if the printer is not needed by all your end users.  Below you will find a script to unmap printer and port created by example script to map printer.  You can place the script(s) on the UEM share, instead of using the UEM File & Folders feature. You can then reference the script(s) by the logon/logoff task feature of UEM.  I created a folder Scripts under the UEM share General folder, and placed both scripts in the folder created.

Manage user personal settings network mapped printers through UEM

Unmap Printer Script

cscript "c:\Windows\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs" -d -p “BizPrinter”

cscript c:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -d -r IP_10.216.40.191

Reply
0 Kudos