Heloo all,
Dim search As DirectorySearcher = New DirectorySearcher(entry)
search.Filter = String.Format("(& (objectClass=user)(samAccountName={0}))", "canallb")
search.PropertiesToLoad.Add("proxyAddresses")
Dim proxyNames As StringBuilder = New StringBuilder()
Dim propertyCount As Integer = result.Properties("proxyAddresses").Count
Dim propertyCounter As Integer
proxyNames.Append("|")
For propertyCounter = 0 To propertyCount - 1
dn = CType(result.Properties("proxyAddresses")(propertyCounter), String)
If dn.Contains("c=GB") = False Then
proxyNames.Append(dn.Substring(5))
proxyNames.Append("|")
End If
Next
But it does not return me x500!!?
what i want to do is like i did for outlook object return value for address :
Dim oApp As Outlook.Application = New Outlook.Application()
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
oNS.Logon(Nothing, Missing.Value, False, True)
' TODO:
Dim oDLs As Outlook.AddressLists = oNS.AddressLists
Dim oGal As Outlook.AddressList = oDLs.Item("Global Address List")
Try
Return "EX:" + oGal.AddressEntries(name).Address()
Catch ex As Exception
Return ex.Message
Finally
oNS.Logoff()
' Clean up.
oApp = Nothing
oNS = Nothing
oDLs = Nothing
oGal = Nothing
End Try
it return me always address like :/o=fabrikam/ou=First Administrative Group/cn=Recipients/cn=kenmyer
which is x500 as i think but when i use Active Directory it does not returns me that value.
Regards.