Windows 7 home premium 64 bit free download utorrent free download
Internet download manager free download full version for windows 10
$printDriverName = "Canon iR-ADV C2020i/C2030i Class Driver"Īdd-PrinterPort -name $portName -PrinterHostAddress "192.168.0.Download free bsplayer for windows xp freebroforce free download pcdownload game pc ringan freewindows 7 wireless driver download free freewindows 7 xp download for pcwindows 10 skins free download freedirectx 11 download free for pcdownload antivirus avira free full version for windows xp freedestiny game free download for pcmicrosoft project 2016 pro iso free downloadīangla font software free download for windows 10īluetooth for pc windows 7 free download 32 bit You can polish this up by adding cmdlet bindings to you can run it from the command line or by including the driver installation as well. Write-Warning "Printer Driver not installed"īelow you will find the complete script for adding a printerport and printer trough PowerShell. $printDriverExists = Get-PrinterDriver -name $printDriverName -ErrorAction Silentl圜ontinueĪdd-Printer -Name "Canon Test Printer" -PortName $portName -DriverName $printDriverName $printDriverName = "Canon iR-ADV C2020i/C2030i Class Driver" If we have a printer driver, then add the printer. So before we are going to add the printer, we check if the printer driver exists.
If you need to install the driver to, then you can use PowerShell for that with the add-printerdriver cmdlet, but you will need Administrator credentials for this.
I deploy some generic print drivers when installing the computers, so they always have the correct driver available. $portExists = Get-Printerport -Name $portname -ErrorAction Silentl圜ontinueĪdd-PrinterPort -name $portName -PrinterHostAddress "192.168.0.200"īefore we can add the printer we need to make sure the printer driver is installed on the machine. You need to add the ErrorAction Silentl圜ontinue switch to suppress the error message you get when you request a non-existing printer port. So what we can do is get the printerport and if it does not exist we create it. By adding the -name switch you can specify the printerport your want to get. This will return a list of all available printer ports. To get the available ports you can use the Get-PrinterPort cmdlet. This way a prevent any error when running the script. Now before we are adding a printerport with PowerShell it is always a good practice to check it port already exists. This will work to: Add-printerport -Name "AwesomePort" -PrinterHostAddress "192.168.0.200" Checking if a PrinterPort Exists Also, the IP Address in the port name isn’t necessary. But I recommend you do because this way you can see in the Printer Server > Ports view on the client which kind of ports are created. To create a TCP Port you don’t need to add TCPPort: in front of it. So you can name the printerport anything you want. Because we entered a PrinterHostAddress the cmdlet knows that you want a TCP port. With the command above you create a TCP print port name “TCPPort:192.168.0.200” with the Ip Address 192.168.0.200. The cmdlet is really simple to use, just add a name and printer ip address to create a TCPIP printerport Add-printerport -Name "TCPPort:192.168.0.200" -PrinterHostAddress "192.168.0.200" We use the cmdlet add-printerport to create a TCP/IP port for our printer. The first step is to create the printerport. So with PowerShell, we can add the printerport and printer on the client without the need of admin credentials.
I am trying to keep the number of installed printers on a client as low as possible, so they don’t have to choose between 20 printers (resulting in a lot of misprints). And they want to install the printer from that location of course. We have clients that go to remote standalone sites with there laptop. Let me first explain why I am using a script to install printers and not a GPO. And that made me thought, why am I not using PowerShell for this…? But today I wanted to create some deployment scripts to do deploy some printers. Really useful if you want to create a batch script so users can install printers them self.
Last year I have written about how you can install a printer and printerport from the command line.