In this lesson, we're going to discuss how to use Mungai to install printers now Monkey is not designed
to install printers, but because monkeys can distribute payloads and run scripts, you can imagine
that there are ways to get monkey to install printers.
So I'm going to show you how I've done it.
And so what you see on this web interface is essentially a Cupps server running Lileks.
And you can see that I've got two printers and one is named very similar to a New York in my New York
computer, and one is named very similarly to my L.A. computer.
And so that's how we're going to create a single package that will install a printer.
And what it's going to do is run a script to try to match a printer name with a computer name and then
install the printer for that particular computer.
Now you can see that we have a Xerox and an HP on here.
And you might be thinking, well, what do we do about the drivers?
Well, Cupps uses PostScript.
And when you have PostScript, you don't really have a driver.
Persay, you have what's called a PDA or printer description file.
Now, the Mac comes with a printer description file in this path over here.
And it's basically it's called generic.
So you have.
You have a generic PPD file.
Now, what I did is I took a look at that generic PPD file and saw that it was missing some features
that I needed.
So essentially what I did is I made a copy of it and then I made some modifications to it by looking
at PPD from printers that had the features that I needed.
So, for example, there wasn't the ability to print two tabloid sized paper and the generic PD file.
So what I did is I went down to paper sizes and you can see right here I've got tabloid and if I go
down to the same spot on the generic PPD file that comes with Mac OS.
We'll see that there is not anything here for tabloid, so by merging a couple of PD files together,
I was able to create a single PD file that had all the features I needed for all the printers on my
network.
Now I have I have about a dozen or so HP black and white in color and Xerox black and white in color.
And I have not found an issue being able to print to any of these printers with my custom PPD.
OK, so we need to make a package file, and so I'm not going to go through every step because we've
done this a few times before.
But before we go to if we do a listing of the payload folder, you can see that in library and then
printers.
I've put my PPD file and if I go into the scripts folder and I go to post and install, then I basically
have a script that will install the printer.
So I'm going to go ahead and explain what this does.
And so, like the first section, these first lines over here, basically this deletes all of the current
printers and installed on the computer.
So you may not want to do this, but I was trying to get all of the local printers and all the old network
printers off of my computers and just use these news, these servers that I was setting up.
And so since I wanted everything to be the same, I thought, well, I'm just going to go ahead and
loop through all the local printers in just a race in the mall.
And so that's what these lines do.
Now, this sets the hostname to the computer name and then what this does is it chops off the last couple
of digits of the computer name, so.
You know, our computers are well, this computers, a one dash one one hundred one, and what that
does is it basically takes the the one off at the end.
And then you saw that our computers are named with hyphens.
And these are underscores because you can't have hyphens and cups print name.
So now I'm converting the hyphens to underscores.
And then what I'm doing here is I'm doing LPI stat, which basically is going to search my my printer
server, which is just called printers, you could see printers over here and printers over here.
And it basically gets a listing of all the print cues that are on the server.
So these and then it moves through the array and then it will do an LP admin, which basically that's
where it's going to install the printer.
So anything that matches.
So what I'm going to do is install a printer with the printer name and this is the path to the printer
and that's a path to the name, which is what basically matches the the computer's name.
This over here.
And then I'm giving it a path to my custom PPD file.
And that's why, again, this is a post install script because the the file has to be laid down on the
computer.
And then we're I'm basically setting a few parameters to the printer, I'm saying that it's that shared
is false and then I'm enabling it and I'm accepting it.
So those are just some Cupps things.
Now, if you have a Windows server, you're going to have to and you want to do this, you're going
to have to come up with the commands to do it.
Now, it is possible, Max can definitely point to Windows servers and say you're just going to have
to look in documentation to find out what the scripts are.
There's just too many variables for me to go over every scenario.
So I'm just trying to share what I do.
So this will either work for you or it will give you some ideas on what you might be able to do in your
location.
All right.
So I've also already gone and imported this.
Both of these are this package into monkeys.
So let's just go ahead and run monkey.
And you can see basically there's no Prenter on these.
And so we've got the install printer job or go ahead and minimize this.
And we've got things still printer job here.
And minimize it and you see got the printer installed.
OK, and so and there's the L.A. printer, so as you can see, it's entirely possible to install printers
with Monkey and hopefully you'll be able to utilize something similar to this so you can make printer
administration easy.