How to Get the List of Deactivated Schema Objects in Active Directory using PowerShell

Custom attributes and classes in Active Directory cannot be removed but can be deactivated instead. Getting the list of deactivated schema objects could be done easily using PowerShell Get-ADObject cmdlet.

The following table represents the required switches and their values:

Switch

Value

Comment

SearchBase

CN=Schema,CN=Configuration,DC=CONTOSO,DC=COM

DC=CONTOSO,DC=COM need to be replaced with the distinguished name of your root domain. The Search Base will be the schema partition of your Active Directory

LDAPFilter

(isDefunct=TRUE)

A deactivated schema object is an object that has TRUE as the value of isDefunct attribute.

The PowerShell command will then be:

Get-ADObject –SearchBase “CN=Schema,CN=Configuration,DC=CONTOSO,DC=COM” –LDAPFilter “(isDefunct=TRUE)”

 


See Also

Another important place to find a huge amount of Windows Server related articles is the TechNet Wiki itself. The best entry point is Windows Server Resources on the TechNet Wiki