- PrintUIEntry allows you to install and list global connections per computer; combine it with PowerShell and Registration for auditing without a GUI.
- WMI and WScript.Network cover mapping, listing, and defaults; IP inventory is resolved with queries to TCP/IP ports.
- Deploy print servers using PowerShell with reproducible drivers, ports, and shared queues.
- UniversalPrintManagement adds cloud management with cmdlets, permissions, connectors, jobs, and reports with robust pagination.

When it comes to managing a network printer fleet in environments Windows, mingle printui.dll to PowerShell It becomes a winning move. Even so, day-to-day life presents us with curious cases: team connections with /ga These are issues that don't appear in the usual cmdlets, errors 740 when installing from standard accounts, and listings that only appear in a graphical window. Here's a practical and in-depth guide to make all of this a breeze.
Everything you will see below is focused on Windows platformswith recipes that work on both client and server and scale very well. You'll see everything from listing and mapping printers with WMI or the WSH COM object to deploying a print server via PowerShell, including Universal Print and its modern cmdlets. And along the way, real solutions to real problems how to capture the global connections that PrintUI installs with /ga or bypass the typical UAC blocks.
PrintUIEntry: connections per device, listings, and common errors

The classic printer installation engine in Windows exposes the entry point PrintUIEntry en printui.dllThis allows actions such as installing queues for all users on the team. /ga, list those queues with /ge or silently register controllers and connections. A typical global deployment command would be: rundll32 printui.dll,PrintUIEntry /q /ga /n\\PRINTSERVER\PRINTERNAME, which leaves that printer available to any user log in to that machine.
The problem arises when trying to inventory those connections. Tools like Get-Printer or the class Win32_Printer WMI does not show the printers added with /ga, and the only command that lists them is rundll32 printui.dll,PrintUIEntry /ge /c «\\ComputerName»The problem is that this list comes out in a GUI windowFor automated alternatives, see how scan devices connected to the network, which offers methods for detection without a graphical interface.
To avoid UAC conflicts when installing drivers on workstations where the user is not an admin, there is a useful trick: from a CMD high you can run rundll32 printui.dll,PrintUIEntry /il. With this it is registers the driver at the administrator level of the system, and from there, the user will be able to add the printer from Settings or Control Panel without encountering the famous error 740Many technicians have encountered this message when deploying manufacturer queues; this method usually resolves the issue (see troubleshooting common printer problems).
If you want to automate the inventory of installed printers with /ga Without relying on the graphical interface, a practical strategy is to consult the system registration keys where Windows stores connections per computer. You can do this remotely with PowerShell and, using the retrieved names, complete the information (driver, port, etc.) by querying the corresponding print server. In cases where Windows does not detect the connected printer It's advisable to combine this data with local and remote diagnoses to gain context. An example of such an approach would be this:
# Lee conexiones globales en un equipo remoto y devuelve nombre de servidor y cola
$computers = @("PC01","PC02")
Invoke-Command -ComputerName $computers -ScriptBlock {
$key = "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Connections"
if (Test-Path $key) {
Get-ChildItem $key | ForEach-Object {
# Los subnombres suelen incluir \\Servidor,Impresora compartida
$parts = $_.PSChildName -split ","
@{
Server = $parts
Printer = if ($parts.Count -gt 1) { $parts } else { $null }
Source = "PrintUI /ga"
}
}
}
}
With the pairs Server/Printer In hand, you can consult the print server to extract technical data such as the driver or port: Get-Printer -ComputerName PRINTSERVER -Name "PRINTERNAME" | Select-Object Name,DriverName,PortName,Shared,PublishedThis pattern allows for complete audits of installed queues using PrintUI /ga on hundreds of computers in a reproducible manner.
Administration with classic PowerShell (WMI and WScript.Network)

To list the printers visible on a computer, the most direct way is to consult the class Win32_PrinterIn modern PowerShell, it's advisable to use CIM: Get-CimInstance -ClassName Win32_PrinterYou'll get queues. local and connected per user with rich properties (whether it is default, whether it is shared, etc.).
Another option is the WSH COM object WScript.Network, which exposes EnumPrinterConnections()This method returns a simple collection with pairs of port and device name Without labels, it's a bit harder to interpret, but effective for quick scripts: (New-Object -ComObject WScript.Network).EnumPrinterConnections().
To add a network printer to a user profile, the COM interface itself is very useful. Simply call AddWindowsPrinterConnection So: (New-Object -ComObject WScript.Network).AddWindowsPrinterConnection("\\\\Printserver01\\Xerox5")If you want to modify the default printer, you can do it in two ways: using WMI to locate the print queue and using SetDefaultPrinteror with the comfort of WScript.Network.SetDefaultPrinter passing the printer name, following the steps to set your default printer.
# Establecer como predeterminada con WMI
$p = Get-CimInstance -ClassName Win32_Printer -Filter "Name='HP LaserJet 5Si'"
Invoke-CimMethod -InputObject $p -MethodName SetDefaultPrinter
# Establecer como predeterminada con WScript.Network
(New-Object -ComObject WScript.Network).SetDefaultPrinter('HP LaserJet 5Si')
To remove a user connection, the same COM object offers RemovePrinterConnection: (New-Object -ComObject WScript.Network).RemovePrinterConnection("\\\\Printserver01\\Xerox5"). This couple COM + WMI It covers most "classic" queue management tasks at the profile and team level.
When you want to go a step further and inventory printers connected via TCP/IP ports by IP address, a useful function is Get-TCPIPPrinterThe idea is simple: consult Win32_TCPIPPrinterPort to obtain the ports and, with each one, locate its associated printer in Win32_PrinterThe result includes additional fields such as the IP of the portIf it responds to ping and the originating device. This function accepts computer name through alternative channeling and credentials.
# Ejemplos de uso de Get-TCPIPPrinter (concepto)
Get-TCPIPPrinter # Equipo local, impresoras por TCP/IP
Get-TCPIPPrinter -ComputerName EQUIPO1 # Equipo remoto por nombre
"PC1","PC2" | Get-TCPIPPrinter # Lista de equipos por pipeline
# Con credenciales y exportando a CSV
$cred = Get-Credential
Get-Content C:\\Equipos.txt | Get-TCPIPPrinter -Credential $cred | Export-Csv C:\\Prn.csv -NoTypeInformation
This WMI approach is robust and very useful for auditingIt allows you to build a reliable inventory of IP listening queues, add operational metadata (latency or ping response time), and export it for analysis. If you're interested in replicating this functionality, the key mechanism is querying... Win32_TCPIPPrinterPort en root/CIMv2, the filtering by PortName en Win32_Printer and error management with Try/Catch when the destination requires or rejects credentials.
In deployments with Active Directory, a very common pattern is map printers by departmentWith PowerShell you can read the attribute department of the user who logs in and cross it with the attribute location from the queues published in Active Directory. If they match, the printer is mapped on the fly for the user. Below is a script summarizing the process:
function Mapear-Impresora($ruta) {
$net = New-Object -ComObject WScript.Network
$impresoras = $net.EnumPrinterConnections()
if ($impresoras -like $ruta) { $net.RemovePrinterConnection($ruta, $true) }
$net.AddWindowsPrinterConnection($ruta)
}
# Usuario actual
$usuario = $env:USERNAME
$filtro = "(&(objectCategory=User)(samAccountName=$usuario))"
$buscador = New-Object System.DirectoryServices.DirectorySearcher
$buscador.Filter = $filtro
$objUser = $buscador.FindOne().GetDirectoryEntry()
# Todas las colas publicadas
$filtroPrn = "(&(objectCategory=PrintQueue))"
$buscador = New-Object System.DirectoryServices.DirectorySearcher
$buscador.Filter = $filtroPrn
$colas = $buscador.FindAll()
# Mapeo por coincidencia Location vs Department
for ($n=0; $n -lt $colas.Count; $n++) {
if ($colas.Properties.location -eq $objUser.Properties.department) {
Mapear-Impresora -ruta $colas.Properties.uncname
}
}
This logic works great as script Of start through GPO, because it ensures that each person automatically receives the queues for their area without manual intervention and with complete consistency across the entire domain. To facilitate access, you can create a direct access to devices and printers that helps users locate their local queues.
Modern management: Print server with PowerShell and Universal Print

If you manage a Windows server and need to standardize the print service, PowerShell allows you to do so. deploy the role, load drivers and publish queues repeatedly. In Windows Server 2022 (also valid in 2016 and 2019), the role is installed with: Install-WindowsFeature -Name Print-ServerAfter that, it is usually advisable Reiniciar the server to save the changes: Restart-Computer.
The next step is to have the driver appropriate for the system. Ideally, download the latest version from the manufacturer and test it first in a test environment. To inject the INF file, use pnputil.exe -i -a "C:\\Ruta\\al\\driver.inf"Verify that the counters Total attempted y Number successfully imported They match. With the INF loaded, register the controller in the spooler with Add-PrinterDriver -Name "HP Universal Printing PCL 6"If you work with HP models, the guide for Configure HP printer on wireless network It can serve as a practical reference for validating connectivity and drivers.
Now create the standard TCP/IP port for the printer's IP address: Add-PrinterPort -Name "10.1.1.123" -PrinterHostAddress "10.1.1.123"Finally, define the shared queue with its driver and port, publishing it if you want it to appear in AD: Add-Printer -Name "HP-UP PCL6" -DriverName "HP Universal Printing PCL 6" -Shared -ShareName "HP-UP PCL6" -PortName "10.1.1.123" -PublishedYou can validate the result with Get-Printer and check that everything is in order.
Although printing may not be the most "glamorous" service in the data center, it is still Key to invoices and reports in many environments. Automating these steps with scripts saves you hours and, above all, eliminates discrepancies between servers. Furthermore, if you combine these techniques with PrintUI's global connections (/ga), you can ensure that stations will always see the corporate queues you need, without relying on manual user actions.
In cloud or hybrid scenarios, Microsoft offers the PowerShell module UniversalPrintManagement to manage Universal Print. It is installed with Install-Module UniversalPrintManagementThe first time you use PSGallery, PowerShell will warn you that it is a untrusted repositoryAnswer “Yes” or “Yes to All” to continue. To uninstall, simply Uninstall-Module -Name UniversalPrintManagement.
Once installed, log in with Connect-UPServicewhich opens a dialog for authentication with your Azure account. The cmdlets follow the convention VERB-NOUN and use the prefix UPYou can discover commands to Get-Command -Verb Get -Module UniversalPrintManagement and consult detailed help, for example, with Get-Help Get-UPPrinter -Detailed.
Keep in mind one important nuance: cmdlets Get-* The module returns paginated results using continuation tokensTherefore, it is recommended to store the answer in a variable and access it. .Results to handle large collections or retries. This model improves the resilience in the event of network outages or timeouts in environments with many printers.
The command repertoire covers several areas: for printers you have Get-UPPrinter y Remove-UPPrinter; for properties, Set-UPPrinterProperty; for shared resources, New-UPPrinterShare, Get-UPPrinterShare, Remove-UPPrinterShare y Set-UPPrinterSharePermission management is covered by Grant-UPAccess, Revoke-UPAccess y Get-UPAllowedMember to check who has access to printing.
The connectors (for integrating local printers with Universal Print) are managed with Get-UPConnector, Remove-UPConnector y Set-UPConnectorPropertyFor operational monitoring, you can consult Get-UPPrintJob and extract usage reports with Get-UPUsageReportThis set allows you to orchestrate the platform from scripts and automate tasks recurrent on a large scale.
As you can see, the Windows printing ecosystem ranges from the old school of WMI and COM to the Universal Print cloud layer, including the installation engine of printui.dllWith a handful of solid patterns, you can cover everything from user mapping and IP inventory to industrial-scale server queue deployment and cloud permission control.
Finally, here's a worthwhile operational guideline: when visibility is your priority, combine the Registry query to list connections by device (/ga) with CIM/WMI to extract technical details and, if you work with Universal Print, absorb the paginated results into variables before processing them. With this combination, you'll have complete, consistent listings that are easy to use in reports or dashboards.
The goal of all the above is to allow you to move from "each PC doing its own thing" to a controlled environment: drivers installed silently To avoid error 740, queues deployed from PowerShell with known ports and controllers, automatic mappings by department, and, when necessary, centralized management in Universal Print with cmdlets that speak the everyday language of an administrator.
Mastering these pieces allows you to work more calmly and with less improvisation: printui.dll for deployment at the team levelClassic PowerShell for local and remote tasks, and Universal Print for scaling and auditing in the cloud. Whatever your starting point, you have more than enough tools to make your printing platform fine-tuned, stable, and well-documented.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.