The specific driver name will also need to be identified. This will require the print driver’s INF file (setup information file) and may require extracting or digging through driver downloads.Īs 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: With the port created, we can work on installing the printer. For local ports, check out PowerShell’s Add-PrinterPort cmdlet: Install Printer Also worth mentioning is that prnport.vbs only works with standard TCP/IP ports and not local printer ports. This particular script does run correctly as SYSTEM user. Notice this step uses the old prnport.vbs. The IP port will be created with this command, replacing the two “Printer-IP”s with the printer’s IP address or hostname: CSCRIPT /nologo %windir%\System32\Printing_Admin_Scripts\en-US\prnport.vbs -a -r "Printer-IP" -o raw -n 9100 -h "Printer-IP" Create TCP/IP Printer Portīefore we can install the printer, we must create a port for it. Once we have the certificate file, the following command will be used to import the cert: C:\WINDOWS\system32\certutil -f -addstore "TrustedPublisher" "Certificate.cer" Continue through the Certificate Export Wizard using the DER Encoded Binary format and save the cert as something like: Certificate.cer Right-click the cert and select All Tasks > Export. In the left pane, navigate to Certificates – Local Computer > Trusted Publishers > Certificates where the recently installed cert should be listed: Then open Start > Manage Computer Certificates. If so, click the Install button and finish installing the printer. To know if you need a cert, install the printer in a test environment and see if a certificate prompt like the following is displayed: But if one does, we will need to use a command to import the cert before installing the printer. Most printers won’t require a certificate. Let’s dive in… Import Certificateįirst thing’s first: certificates. 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. My latest method involves using PRINTUI.DLL with RUNDL元2.EXE which are also native Windows tools. 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 Run Command Prompt as NT AUTHORITY\SYSTEM to test SCCM Applications to learn how to test such things). When installing applications for the entire system (all users), SCCM will run installs as the Windows built-in SYSTEM user. My current issue with these is a result of my use of System Center Configuration Manager. I was previously a fan of the prndrvr.vbs, prnmngr.vbs, and prncnfg.vbs scripts that have existed natively in Windows for many years. I’ve used several methods to accomplish this. Installing printers from Windows command line can be tricky, especially if you are attempting to keep things silent. Successfully Tested On: Windows 7 Enterprise SP1, Windows 10 Enterprise versions 1507 - 22H1, Windows 10 Long-Term Servicing Branch (LTSB) versions 1507 & 1607, Windows 10 Long-Term Servicing Channel (LTSC) versions 2015 - 2019, Windows 11 version 22H1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |