Hello,
To find indexed attributed, you need to open the schema management console, and see the properties of the attributes :
As you can see, there is a case ticked named “Index this attribute”, that means this attribute is indexed.
You can repeat that operations on all attributes, or you can use this :
#Indexed Attributes
$dse = [adsi]“LDAP://RootDSE”
$SchemaPart=$dse.schemaNamingContext
$InexedAttSearcher=[ADSISearcher]"(searchFlags:1.2.840.113556.1.4.803:=1)"
$InexedAttSearcher.SearchRoot=[adsi]"LDAP://$SchemaPart"
$InexedAttSearcher.FindAll() | Select-Object -ExpandProperty Path | % {($_ -split ",")[0]} | % {($_ -split "=")[1]} | Sort-Object
Here is an alternative last line to your script. The benefit is it shows the attribute names you see in ADUC versus the hyphenated ones.
($InexedAttSearcher.FindAll() | Select-Object -ExpandProperty Properties).ldapdisplayname | sort
Yes, or : $InexedAttSearcher.FindAll() | % {$_.Properties.Item(\’LDAPDisplayName\’)} 🙂