Link to home
Start Free TrialLog in
Avatar of Duncan Andrews
Duncan Andrews

asked on

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
Avatar of Giridhara Raam M
Giridhara Raam M
Flag of India image

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
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
Avatar of Duncan Andrews
Duncan Andrews

ASKER

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
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.
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.

User generated image
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.

 User generated image
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.

User generated image
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.

User generated image
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.

User generated image
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.
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.
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:
User generated image
The problem I have is that the printer itself is not installed in Windows even though it is listed under Printers & Scanners:
User generated image
The printer is listed in Device Manager under Software Devices:
User generated image
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
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.
ASKER CERTIFIED SOLUTION
Avatar of Duncan Andrews
Duncan Andrews

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, thanks for the update and good luck.
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"
This was the solution for the author.