'This code gets the exchange server's computer name. ' 'References needed: MAPI ' ' 16/04/2002 John Liu Private Function ExchangeName() As String Dim s As New MAPI.Session() s.Logon(, , , False, False) ' Get current user address entry ID Dim strUserID As String = s.CurrentUser.ID ' Get the home server name out of the home MTA property Dim strhomeserver As String strhomeserver = s.GetAddressEntry(strUserID).Fields(PR_EMS_AB_HOME_MTA).value ' Get the actual name of the Exchange Server strhomeserver = Mid(strhomeserver, InStr(1, strhomeserver, "/cn=Configuration/cn=Servers/cn=") + _ Len("/cn=Configuration/cn=Servers/cn="), 255) strhomeserver = Left(strhomeserver, InStr(1, strhomeserver, "/") - 1) s.Logoff() Return strhomeserver End Function