You can read the attribute names in the Schema container. You probably want the lDAPDisplayNames rather than the common names. Then for each attribute you would query for all objects in the domain that have values assigned to the attribute. This would take
a lot of processing. There are over 1300 attributes, and some mandatory for all objects (like distinguishedName and objectGUID). And, if you query the domain for objects that have values assigned, this will not include any objects in the Schema, Configuration,
or any application partitions.
To retrieve lDAPDisplayNames of all attributes in the schema:
dsquery * "cn=Schema,cn=Configuration,dc=MyDomain,dc=com" -Filter "(objectClass=attributeSchema)" -Attr lDAPDisplayName -Limit 0 > Attributes.txt
To check how many objects have values for any given attribute (for example "displayName"):
dsquery * -Filter "(displayName=*)" -Limit 0 | find /c ",dc="
but this will only include objects in the domain partition.