5

I had a standalone Windows 2012 box that was acting as the printer server in my domain. Since then I've removed it and moved printer hosting elsewhere.

However, when I open up the directory (through "add a network printer"), I still see printers that were hosted by that old server. How can I remove those directory entries if the server is no longer around?

2 Answers2

9

You should be able to manually remove them from AD. If the previous print servers computer object still exists you can delete the printers from the servers computer object in ADUC by selecting the option to view Users, Contacts, Groups and Computers as objects, then find the computer object for the previous server, select it in the left pane and delete the printers in the right pane.

You can also create a query in ADUC to find all printers and then delete them from the query results.

Additionally, directory pruning of printers should happen automatically, unless directory pruning has been disabled via GPO.

How long has this printer server been offline or is it that the server is still running but no longer serving as a print server?

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • 1
    Ah, I hadn't deleted the Computer object from ADUC. I could have sworn I had, which was what had me confused. Removed the printers through ADUC, which solved the problem and then properly removed the object. –  Feb 19 '15 at 18:40
  • Glad you got it sorted out. – joeqwerty Feb 19 '15 at 18:44
0

Depublish printers on an alive server or deletion of publish printers might also fail if one has enabled protectedFromAccidentialDeletion.

like this

Get-ADObject -Filter * -SearchBase 'OU=Servers,DC=domain,DC=local' | Set-ADObject -protectedFromAccidentalDeletion $true

The Get-ADObject will not only select OU, Computers and Users, but also Container objects, even causing the regular depublish process to fail without any warning.

Quite self explaining one would have to remove the protection from the object.

Get-ADObject -Filter 'Objectclass -eq "computer"' -SearchBase 'OU=Servers,DC=domain,DC=local' | Set-ADObject -protectedFromAccidentalDeletion $true
Karl
  • 3
  • 2
Karl
  • 1