I have an AD query, and adding properties manually, but I want the ability to add ALL active directory properties that a user can have to the searcher.
This is the current way i'm doing it, which works fine and dandy...
Dim de As New DirectoryEntry
If getset.impersonationset = True Then
    If getset.specificcontainerchecked = True Then
        de.Path = "LDAP://" & getset.containerstring()
        de.Username = getset.usernameset
        de.Password = getset.passwordset
    Else
        de.Path = "LDAP://" & getset.DomainName()
        de.Username = getset.usernameset
        de.Password = getset.passwordset
    End If
Else
    If getset.specificcontainerchecked = True Then
        de.Path = "LDAP://" & getset.containerstring()
    Else
        de.Path = "LDAP://" & getset.DomainName()
    End If
End If
Dim deSearch As New DirectorySearcher()
deSearch.SearchRoot = de
deSearch.Filter = "(&(objectClass=User)(objectCategory=Person))"
deSearch.PageSize = 1000
deSearch.SizeLimit = 1000
If getset.specificcontainerchecked = True Then
    If getset.subcontainers = True Then
        deSearch.SearchScope = SearchScope.Subtree
    ElseIf getset.subcontainers = False Then
        deSearch.SearchScope = SearchScope.OneLevel
    End If
ElseIf getset.specificcontainerchecked = False Then
    deSearch.SearchScope = SearchScope.Subtree
End If
deSearch.PropertiesToLoad.Add("sAMAccountName") 'Account Name
    deSearch.PropertiesToLoad.Add("givenName") 'Display Name
    deSearch.PropertiesToLoad.Add("sn") 'Load Users first name
    deSearch.PropertiesToLoad.Add("description") 'Description
    deSearch.PropertiesToLoad.Add("userAccountControl")   'Distinguished Name
    deSearch.PropertiesToLoad.Add("lastLogonTimestamp") 'Last Login
    deSearch.PropertiesToLoad.Add("whenCreated") 'Created Date
    deSearch.PropertiesToLoad.Add("whenChanged") 'Changed Date
    deSearch.PropertiesToLoad.Add("distinguishedName")
    deSearch.PropertiesToLoad.Add("msNPAllowDialin")
    deSearch.PropertiesToLoad.Add("cn") 'Wiles, Anthony
    deSearch.PropertiesToLoad.Add("co") 'United States
    deSearch.PropertiesToLoad.Add("company") 'Company
    deSearch.PropertiesToLoad.Add("l") 'Alpharetta
    deSearch.PropertiesToLoad.Add("mail") 'Email
    deSearch.PropertiesToLoad.Add("st") 'State
So I thought I would try to add them all, so a user could pick and choose which attributes they wanted... so I came up with this.
 Dim currSchema As ActiveDirectorySchema = ActiveDirectorySchema.GetCurrentSchema()
 Dim collection As ActiveDirectorySchemaClass = currSchema.FindClass("user")
 Dim properties As ReadOnlyActiveDirectorySchemaPropertyCollection = collection.GetAllProperties()
 Dim enumerator As IEnumerator = properties.GetEnumerator()
        While enumerator.MoveNext()
            Try
                deSearch.PropertiesToLoad.Add(enumerator.Current)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End While
But i'm getting the following error for most of them..
Conversion from type 'ActiveDirectorySchemaProperty' to type 'string' is not valid.
Any clues on what i'm missing? I realize it cannot cast ADSP to type string, but i'm not sure how to fix it. I'm sure some of them are Boolean, ints, datetime.