install printer script

urjudo
urjudo used Ask the Experts™
on
Hi experts,
Does any one has experience how to write a script to install printer and check toner status in command line or power shell?  if you do, can you give me some advise or a sample?  I'm totally new with this and have no idea where and how to start. (we're going to moving from windows 7 to winodows10 with office 365)

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Darrell PorterEnterprise Business Process Architect

Commented:
What printer model and what version of the driver?  Those two factors will determine whether the desired information is exposed to the WMI or other means open to Powershell to read it.
Enterprise Business Process Architect
Commented:
There is this script which claims to do what you need with regard to determining toner level.

I would imagine that you would use a separate script to install the printer drivers (via MSIExec.exe for example) then it could call the Get-Toner script.
Kesavan JeganarayananIT Consultant

Commented:
1. Switch to the Start menu by pressing the WINDOWS key.
2. Type powershell, select Windows PowerShell from the search results and press ENTER.
3. In the PowerShell prompt, type add-printerport –name “192.168.1.10” –printerhostaddress “192.168.1.10” and press ENTER, replacing 192.168.1.10 in both fields with your printer’s IP address. If you want to use a DNS name instead, replace 192.168.1.10 in the –name field with a 4. simple friendly name that you use to identify the port, such as Xerox.
5. Now type add-printer –name “Xerox WorkCenter” –drivername “Xerox WorkCentre PE114_16_16e” –port “192.168.1.10” and press ENTER, replacing 192.168.1.10 with the name of the port you chose using the add-printerport cmdlet.
Expert Spotlight: Joe Anderson (DatabaseMX)

We’ve posted a new Expert Spotlight!  Joe Anderson (DatabaseMX) has been on Experts Exchange since 2006. Learn more about this database architect, guitar aficionado, and Microsoft MVP.

Author

Commented:
@Darrell, I'm going to take a look of the link.  Thanks
@Kesavan, am i use PS or PS ISE?  if I have 40 printers, then I have to type add-printerport 40 times for each printer IP?   sorry, I'm really new to PS and trying to learn it from youtube.  I may have some questions, please be patience with me.  thanks
Kesavan JeganarayananIT Consultant
Commented:
Hi Urjudo

Here one link, but i haven't tested yet. You can give a try.
https://www.pdq.com/blog/how-to-add-printers-with-powershell/

Author

Commented:
Thank you both experts helped!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial