[Autogenerated] Drivers act like translators between
your computer and the printer,
making sure the print job is understood by both parties.
What a print driver is essentially does is convert the data
into a format that the printer can understand.
However, drivers are not without issues.
Common problems can include outdated drivers or incompatible versions
which can throw a wrench in your printing tasks.
Common printer driver issues could be as minor as slight print
deformities or as serious as failed print jobs.
So managing your driver is essential updating and rolling back
drivers can be done to solve these issues.
It's time to learn about printer drivers hands on.
Let's get into another demo where we're going to first learn how
to find all installed drivers at PowerShell,
we'll then update a driver and then the most useful feature of all,
we'll learn how to back up and restore a printer driver.
So I'm here on my SB one print server and to start off
with let's create an example printer.
And since I don't have any physical printers in my environment,
i'll create a MOC printer with the ad printer command.
This command is adding a printer named Mac printer that use the
Microsoft print to PDF driver and using the LPT one port.
Since the Microsoft print to PDF driver is a default driver.
I di I didn't need to actually install anything to get this prayer going.
So now let's confirm that the printer was created.
Yep, I see a local printer name there,
the driver it's supposed to use and the port next,
we need to list all the printer drivers installed on this
machine to figure out if they're up to date.
And to do that, I can use the GIT printer driver command.
This command returns a list of all the installed print drivers
making it easier to spot any that may need updating.
In this case,
we're using a printer that's using that Microsoft printed PDF driver.
It looks like it's at version four.
Now, now let's update our MOC printers driver.
Of course, we're just simulating here.
You now you typically download the new driver and install it.
But for now, we'll switch the driver using set printer, great no errors.
The mock printer should now be using that other driver and last but not least,
always be prepared to roll back.
So before updating the driver, let's first back up that current driver,
the drivers are stored in inf files.
You can find the INF file for a driver with the get printer driver command and
there is an INF has property that I'm going to look for.
Now, you can see the inf file for that printer,
then you can use the git child item command to
confirm it exists on the file system.
So it looks like it does exist or you could actually
use the test dash path command lit.
If you would like if it's not a folder, sometimes it's a folder,
sometimes it's an individual file.
Now, since the directory for that printer driver may change when you re update,
you copy the entire directory that that INF file is in.
If it contains other INF files,
let's see what this folder contains to make sure there's
nothing anything else besides that one INF file.
So you can see there's quite a bit of other files in there.
Now to copy this,
you can capture the directory name if you want to
automate this and copy the entire directory.
So here I am getting that print driver inf path.
I'm passing it to split path, dash parent,
which is going to get me the name of the directory itself.
So instead of copying and pasting, I could simply pipe that through split path.
And there you can see that it's just simply giving the path to the directory.
And then once I get the path to directory,
I can pipe that to copy item and then specify a
destination of wherever we want to back up to.
In this case, I have a folder called driver's backup.
And I'm going to recurs which means if there are any
sub folders in that directory, it's going to go ahead and get those.
So now that I have that,
let me check my driver's backup folder and you can see that they are there.
So everything is backed up.
Now, you're safe to update the driver.
We'll have to use a command line utility called PNPU till this is a
handy utility to manage Windows drivers in general.
So first I need to find the actual name of the driver that PNP TI is using
because sometimes it's not the same as the actual file name.
And to do that, I can use the PNPU till switch called enum drivers.
And looking through here,
you can see one of these has the original name of Pr N MS 001 dot Inf.
That is the one that I'd need.
It looks like the actual name it needs to be is OE MSE dot Inf.
That's the one that I can reference it with.
So now that we have the actual name of the driver to remove,
I can remove it since the newer driver is installed,
I can then install back the old driver that we
backed up by pointing to the backup.
And now you can see that it again made the OEM six dot inf.
So we backed it up, removed it, we restored the backup.
Now, if you need to roll back the original driver,
you can first stop the prints spooler from holding the files.
And then once you've done that you can copy all those
files back into the original directory.
Oh,
looks like I had the wrong path and we'll try this again
with the right path and Voila it is back.
You're now back at your original driver and don't
forget to start the spooler again.
Today we went over how to manage printer drivers using PowerShell.
We created the MOC printer, we listed installed drivers.
We,
we went through the process that you would go through when
updating a driver and rolled back all the changes,
all this without ever touching the gooey.