Hi, I want to know how to get all the SMTP or Exchange servers(IP or Hostname) in a network using VC++ (Visual Studio 2005). Thank You - John Paul
You can use AD: look for the msExchHomeServerName attribute for a given AD entry. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "John Paul" wrote in message news:E4102EC6-C91A-442E-BA11-B62715EC139E@microsoft.com... > Hi, > > I want to know how to get all the SMTP or Exchange servers(IP or Hostname) > in a network using VC++ (Visual Studio 2005). > > Thank You > - John Paul
Hi Dmitry, Thanks for the information. The problem with this approach is AD server address should be known. I would like to know if by using the IP address of a computer in a network, is it possible to determine if it is fully functional SMTP server or not. Please Advice -John Paul "Dmitry Streblechenko" wrote: > You can use AD: look for the msExchHomeServerName attribute for a given AD > entry. > > -- > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > - > "John Paul" wrote in message > news:E4102EC6-C91A-442E-BA11-B62715EC139E@microsoft.com... > > Hi, > > > > I want to know how to get all the SMTP or Exchange servers(IP or Hostname) > > in a network using VC++ (Visual Studio 2005). > > > > Thank You > > - John Paul > > >
Nope, if you are on a domain, it is all easily accessible: 1. Retrieve the current user domain/name (NetWkstaUserGetInfo) 2. Create an intance of the "NameTranslate" COM object, translate the name from ADS_NAME_TYPE_NT4 to ADS_NAME_TYPE_1779 3. Call ADsGetObject specifying the LDAP address of the current user and requesting the IID_IADsUser interface 4. Call IADsUser::GetInfoEx("msExchHomeServerName") -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "John Paul" wrote in message news:6745F16C-A43D-4C79-9345-9EF761BF8B9B@microsoft.com... > Hi Dmitry, > > Thanks for the information. The problem with this approach is AD server > address should be known. I would like to know if by using the IP address > of a > computer in a network, is it possible to determine if it is fully > functional > SMTP server or not. > > Please Advice > -John Paul > > "Dmitry Streblechenko" wrote: > >> You can use AD: look for the msExchHomeServerName attribute for a given >> AD >> entry. >> >> -- >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> - >> "John Paul" wrote in message >> news:E4102EC6-C91A-442E-BA11-B62715EC139E@microsoft.com... >> > Hi, >> > >> > I want to know how to get all the SMTP or Exchange servers(IP or >> > Hostname) >> > in a network using VC++ (Visual Studio 2005). >> > >> > Thank You >> > - John Paul >> >> >>
I have some code for this...but its all mixed up...I will post it by EOD. It queries the exchange server names (MX records) for a given domain name. Regards, Ashutosh John Paul wrote: > Hi Dmitry, > > Thanks for the information. The problem with this approach is AD server > address should be known. I would like to know if by using the IP address of a > computer in a network, is it possible to determine if it is fully functional > SMTP server or not. > > Please Advice > -John Paul > > "Dmitry Streblechenko" wrote: > >> You can use AD: look for the msExchHomeServerName attribute for a given AD >> entry. >> >> -- >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> - >> "John Paul" wrote in message >> news:E4102EC6-C91A-442E-BA11-B62715EC139E@microsoft.com... >>> Hi, >>> >>> I want to know how to get all the SMTP or Exchange servers(IP or Hostname) >>> in a network using VC++ (Visual Studio 2005). >>> >>> Thank You >>> - John Paul >> >>
http://www.codeproject.com/KB/tips/CSMTPConnection2.aspx -- V. This posting is provided "AS IS" with no warranties, and confers no rights. "Ashutosh Bhawasinka" wrote in message news:urZtc5b1IHA.5832@TK2MSFTNGP02.phx.gbl... >I have some code for this...but its all mixed up...I will post it by EOD. >It queries the exchange server names (MX records) for a given domain name. > > Regards, > Ashutosh > > John Paul wrote: >> Hi Dmitry, >> >> Thanks for the information. The problem with this approach is AD server >> address should be known. I would like to know if by using the IP address >> of a computer in a network, is it possible to determine if it is fully >> functional SMTP server or not. >> >> Please Advice >> -John Paul >> >> "Dmitry Streblechenko" wrote: >> >>> You can use AD: look for the msExchHomeServerName attribute for a given >>> AD entry. >>> >>> -- >>> Dmitry Streblechenko (MVP) >>> http://www.dimastr.com/ >>> OutlookSpy - Outlook, CDO >>> and MAPI Developer Tool >>> - >>> "John Paul" wrote in message >>> news:E4102EC6-C91A-442E-BA11-B62715EC139E@microsoft.com... >>>> Hi, >>>> >>>> I want to know how to get all the SMTP or Exchange servers(IP or >>>> Hostname) >>>> in a network using VC++ (Visual Studio 2005). >>>> >>>> Thank You >>>> - John Paul >>> >>>
=?Utf-8?B?Sm9obiBQYXVs?= wrote in news:6745F16C-A43D-4C79-9345-9EF761BF8B9B@microsoft.com: > Thanks for the information. The problem with this approach is AD > server address should be known. I would like to know if by using the > IP address of a computer in a network, is it possible to determine if > it is fully functional SMTP server or not. If you don't have any sort of directory to work with, you could just try talking SMTP to that machine and see what happens.. -- dan
Have a look at this example http://www.naughter.com/smtp.html this application has the ability to query the MX records for a given domain. What it does is that if you enable MX lookup check box at the end, it gets the recipients domain name and then query for that domain's SMTP server. For building this application read this http://naughter.spaces.live.com/blog/cns!7692E6D72E26EAC!209.entry follow the second method, it's very convenient than building/compiling the OpenSSL (it requires changing/adding lots of compiler switches) Regards, Ashutosh