How to remotely uninstall Software Devices from Windows 10

I have a number of Windows 10 devices that display old printer drivers that we no longer use.  I would like to remove all these from all machines.  All machines are joined to an Azure AD.  These devices are listed under Device Manager\Software Devices.  See the attached picture.
Old-Printers.PNG
Duncan AndrewsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Giridhara Raam MDigital Marketing SpecialistCommented:
This expert suggested creating a Gigs project.
Try using Desktop Central, an endpoint management solution which is also available in Azure cloud. It helps in managing all your software, hardware, measure them effectively, add/remove them and more.

Try here: https://www.manageengine.com/products/desktop-central/download-free.html
0
MacleanSystem EngineerCommented:
Write a powershell script to remove the print drivers.
I am not a scripting genius, but I think the below should work.

Remove-PrinterDriver –Name "Toshiba e-Studio 2550cse Printer 1"
Remove-PrinterDriver –Name "Toshiba e-Studio 2550cse Printer 2"
Remove-PrinterDriver –Name "TOSHIBA e-STUDIO2555C-07902562"
exit

Open in new window


Create the script and deploy it using a startup script or scheduled task.
More info on the script parameters located here
0
Duncan AndrewsAuthor Commented:
Thank you for your help Maclean but it didn;t work I'm afraid.  I got the following error message:
Remove-PrinterDriver –Name "Toshiba e-Studio 2550cse Printer 2"
Remove-PrinterDriver : No MSFT_PrinterDriver objects found with property 'Name' equal to 'Toshiba e-Studio 2550cse
Printer 2'.  Verify the value of the property and retry.
At line:1 char:1
+ Remove-PrinterDriver –Name "Toshiba e-Studio 2550cse Printer 2"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Toshiba e-Studio 2550cse Printer 2:String) [Remove-PrinterDriver], CimJ
   obException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound_Name,Remove-PrinterDriver
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

MacleanSystem EngineerCommented:
I think that perhaps what the command might be expecting is the printer shared name if existing in this case.
Let me check on a computer at my end and confirm. Will get back to you when I can. Working in between.

Would you mind letting me know whether these printers were installed with an exe installer by the way?
I downloaded the driver and noticed it can be deployed via a setup program too, which will likely have a uninstall option in add/remove programs if so, adding more options for removal.
For my test at my end I will install it manually as if deployed from a print server.
0
MacleanSystem EngineerCommented:
Right. I deployed the latest driver available for this printer from Toshiba.
Now when I run get-printerdriver on powershell I can see it listed as Toshiba Universal Printer 2.
This is different to your driver likely but the theory should be the same.

1.PNG
Running the command I gave I receive a different output however. This makes me believe that the name you have is not what would be provided running the Get-PrinterDriver Commandlet as it does appear to attempt to remove the driver, but as it is in use (as in I still have the printer showing under printer management) I need to remove the printer first.

 2.PNG
Let's assume you will find the right printer driver name using the get-printdriver command and bump into the same issue as me.
Some additional steps will be required in this case. As mentioned, if it finds the printer but claims it is in use which means that I still have the printer listed under printers.  (If you did not have printer listed in printers, only drivers then you can skip the next steps and go straight back to using the remove-printdriver -name drivername cmdlet))

To find my printer name.

Run Get-Printer | fl name

This will display the printer names installed.
For me it showed as per below. Copy the printer name which needs to be removed.

3.PNG
When done run Remove-Printer -name "printername" to delete the printer.
Follow this up with get-printer | fl name to confirm the printer is no longer listed.

4.PNG
When done we can run the Remove-PrinterDriver -name "drivername" Cmdlet which should now succeed.
Follow that up with the Get-Printerdriver Cmdlet to confirm driver was removed.

5.PNG
I realise this does not provide you with a fully automated script as yet, but it provides you with the info required to locate the right parameters for the script.
Assuming all systems have had the same printer & printerdriver deployed, you could then write a script to remove printer, followed by printername.

Hope that helps.
0
MacleanSystem EngineerCommented:
In a nuthell.

Run Get-Printerdriver to get the right print driver name.
Run Get-Printer | fl name to obtain deployed printer name.
Run Remove-Printer "printername" to remove printer if deployed
Run Remove-PrinterDriver "Drivername" to remove driver.
0
Duncan AndrewsAuthor Commented:
Maclean - Many thanks for your time and efforts and apologies but I probably wasn't clear enough.

Here is my list of printers from get-printer:
get-printer result
The problem I have is that the printer itself is not installed in Windows even though it is listed under Printers & Scanners:
Capture11.PNG
The printer is listed in Device Manager under Software Devices:
Capture12.PNG
If I manually delete it from Software Devices in Device Manager then it disappears from Printers and Scanners, but a  minute or 2 later it reappears in both!!
Thanks again for your time
Capture10.PNG
0
MacleanSystem EngineerCommented:
Right, that is peculiar. To be listed in device manager without errors would generally require drivers.
To be listed in printer console showing no drivers present, even though device manager does not show an error is odd.
If you check the driver version in Device Manager, what does it display please?

Also in an administrative CMD prompt please enter SET DEVMGR_SHOW_NONPRESENT_DEVICES=1
When done either type devmgmt.msc in the same prompt to open up device manager, or open it any other preferred way.
When Device Manager loads select View tab, and select Show hidden devices.
See whether any further Toshiba devices appear and try removing them all then reboot and check if they are back.
.
Finally would you mind running the get-printerdriver command in powershell to see which drivers are listed. Similar to your get-printer screenshot.
0
Duncan AndrewsAuthor Commented:
I should update you.

Yesterday, I ran these commands and the printer disappeared from Device Manager and Printers and Scanners:

devcon disable find *Toshibae-studio2555C"
devcon remove find *Toshibae-studio2555C"

So I am probably sorted.  

Many thanks for your time.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MacleanSystem EngineerCommented:
Ok, thanks for the update and good luck.
0
MacleanSystem EngineerCommented:
Solution was not to use remote management tools but to disable device in device manager, then remove, as per authors own comments.
Neither my own or other EE's comments resolved the issue. Hence I object to current closure suggestion and believe the job should be closed using the authors comments.

Author Comment

by:Duncan Andrews
ID: 42404141
2017-12-15
I should update you.

Yesterday, I ran these commands and the printer disappeared from Device Manager and Printers and Scanners:

devcon disable find *Toshibae-studio2555C"
devcon remove find *Toshibae-studio2555C"
0
MacleanSystem EngineerCommented:
This was the solution for the author.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.