Using A Script To Install Printers Remotely
Successfully Tested On: Windows 7 Enterprise SP1, Windows 10 Enterprise versions 1507 - 1903, Windows 10 Long-Term Servicing Branch (LTSB) versions 1507 & 1607, Windows 10 Long-Term Servicing Channel (LTSC) version 1809Installing printers from Windows command line can be tricky, especially if you are attempting to keep things silent. I’ve used several methods to accomplish this.I was previously a fan of the prndrvr.vbs, prnmngr.vbs, and prncnfg.vbs scripts that have existed natively in Windows for years. My main issue with these is a result of my use of System Center Configuration Manager. When installing applications for the entire system (all users), SCCM will run installs as the SYSTEM user.

SYSTEM is fine for most executions, but some of the aforementioned visual basic scripts will not complete when ran as the SYSTEM user ( see post to learn how to test such things).My latest method involves using PRINTUI.DLL with RUNDLL32.EXE which are also native Windows tools. I’ve found this method to execute correctly even as SYSTEM user, so it’s what I’m still using for my printer installs today. Let’s dive in Install PrinterInstalling the printer requires two commands.First create the IP port with this command, replacing the two “Printer-IP”s with the printer’s IP address or hostname: CSCRIPT /nologo%windir%System32PrintingAdminScriptsen-USprnport.vbs -a -r 'Printer-IP' -o raw -n 9100 -h 'Printer-IP'Notice this step uses the old prnport.vbs. This particular script does run correctly as SYSTEM user.The second command requires the print driver’s INF file (setup information file), and this may require extracting or digging through driver downloads.As an example, a Sharp printer I was recently working with uses the driver file su0emenu.inf which I found in the extracted drivers I got from their website:The specific driver name will also need to be identified.
Has anyone ever confirmed this script working on Windows 10 Pro? I notice it is only confirmed on enterprise/ltsb/ltsc.
In my testing on Win 10 Pro everything works except importing of the settings.dat file. I receive an error message “Operation could not be completed (error 0x0000000c) The access code is invalid” I have tried the script with Sharp mx-4111N, mx-6240n and mx-5070n printers. I have tried the script typing out all locations instead of using variables and as SYSTEM user via psexec. I am already using the working portions of the script in production with our management system to automatically install printers at remote locations when a computer checks in with a remote branch offices unique network address. So much thanks for sharing this script! It would be phenomenal if I could just get the final step of importing the Sharp device settings into the process.Like.
First off I just want to say thank you for this. I provide support for a construction company with lots of smaller site offices, we can’t have print servers due to the size / connection speed, so the onsite routers have VPN and the printer is connected to those. We then set the users up via Direct IP Printing and push it out to the users via Lansweeper.We have a lot of Sharps and they have been a pain, how do you go about the auto config options etc, as I have found that with out sharps they are missing addition paper feeder units, so we need to run the auto configuration.
The issue I find is those settings then don’t carry over to the deployments when running the above listed commands.Am I missing something or if you run the auto config, get the paper trays etc, then export those settings it should be retained when installing via rundll32 printui.dll,PrintUIEntry /Sr /n “Printer-Display-Name” /a C:PrintSettings.dat m f g pAssistance would be greatly appericated.Like. I don’t deploy any USB printers in my environment, but I do know that prnport.vbs is specifically for managing TCP/IP printer ports and not local printer ports.
I might suggest you look into the Add-PrinterPort PowerShell cmdlet if you need to create a local printer port, but USB plug and play really should take care of creating the port/installing the printer/applying the compatible driver (if driver is found on the system or in Windows Update). You might consider using SCCM to push the driver out to all necessary computers and then letting plug and play take care of the port creation/printer install/driver application when the printers are plugged in USB to said computers.That being said, the printui.dll install method mentioned in the OP will still work fine to install USB printers, just use the /r flag to point to a local port name instead of an IP port name.Like.

In ',' I observed that many folks have decided to skip Windows 8 thanks to its (ahem) less-than-sterling reputation—but those who have decided to adopt Windows 8 are discovering a bevy of hidden treasures. Among those gems are 20 useful printer-related cmdlets. In that article, I showed how the add-printerdriver cmdlet lets you designate one or more printer drivers as essentially 'safe for the non-admin user to use,' paving the way for a cmdlet that I'll cover this time: add-printer.As you've probably already guessed, add-printer lets you install a printer. That doesn't sound exactly scintillating—except for two things. First, add-printer is a command-line tool, which makes automating it easy.
Second (and here's the really nice part), non-administrative users can run it, which means that automating it is as simple as putting the cmdlet in a user's logon script. (If that sounds troubling, remember that a user can't create a printer unless you approve that printer's driver.)Add-Printer OptionsThe add-printer cmdlet has a lot of options, but here's the basic syntax: add-printer -name -drivername -portThe first option is just the name you want to appear in Devices and Printers (e.g., 'Upstairs laser').
Flag for inappropriate content. Read Free For 30 Days. Related titles. Carousel Previous Carousel Next. Abel carlevaro cuaderno 4 pdf.
Using A Script To Install Printers Remotely To Mac
The driver name is the same name you used in add-printerdriver (e.g., Brother HL-4040CDN Series, HP Deskjet 5700 Series, Dell Color Laser 1320c). But what about the port name? You've seen the PowerShell nouns printer and printerdriver, but there's one more to learn: printerport.You can see your system's printer ports by typing get-printerportYou'll probably get a lot of results. Figure 1 shows a few from my system. I created the port named ToColor. I had a network-attached printer on my intranet—a Dell 1320c sitting on 10.50.50.50—that I wanted to connect to a workstation.Figure 1: Printer PortsSo, I had this much of the add-printer cmdlet so far: add-printer -name 'ColorDell' -drivername 'Dell Color Laser 1320c'What about -port?
If the printer were directly USB-attached, I could use -port USB001, but I wouldn't because the system's built-in Plug and Play (PnP) infrastructure identifies the port name automatically. But if I wanted to connect to a network-attached printer, then my system needs a little help. Assuming I know the IP address or DNS name of the printer, PowerShell's add-printerport lets me create a port to that address. So, if my Dell 1320C is at 10.50.50.50, I can create a network port to it with the command add-printerport -name 'ToColor' -printerhostaddress '10.50.50.50'That's very simple, because I really only have to give the port a name ('ToColor') and an IP or DNS address. (You need only standard user privileges to create printerports with PowerShell.) With the printerport in place, any user with access to the Dell 1320C drivers can connect, like so: add-printer -name 'ColorDell' -drivername 'Dell Color Laser 1320c' -port 'ToColor'What About Shared Printers?So you can connect to a local printer with a simple add-printer cmdlet in two situations: A locally attached printer needs just a name and a driver's name, and a network-attached printer needs one more thing: a port.
But those two scenarios leave out the most common situation, which is connecting to a printer shared via a server.To connect to one of those, you need only an option: -connectionname. For example, suppose I've connected that Dell 1320C printer ('ColorDell') to a server called Netdoor and shared that printer as netdoorPL. My workstation could then connect with just - connectionname, as in add-printer -connectionname netdoorPLIn that case, I'd end up with a printer named netdoorColorDell and yes, you read that right: PowerShell gives that connection a name that isn't blindly equal to the UNC path but rather blends the server's name and printer name perceived by the print server.Printer RemovalWhat about disconnecting? If you're even a bit PowerShell-adept, you'll already know that PowerShell's verb for deleting or eliminating something is remove, and you'll have guessed that you delete a printer with remove-printer, as in remove-printer 'Downstairs Printer'Always remember that although I often use uppercase and lowercase in my examples to make them a bit more readable, PowerShell is almost always case-insensitive. So, remove-printer 'DoWNstaiRS PRINTER' would work just as well.