How can I find my Exchange Server name?

rbc827

Member
Joined
May 7, 2007
Messages
17
Programming Experience
Beginner
I'm building an application that list certain attributes about a persons computer, and I want to list the name of the Exchange Server they connect to. We have 5 different Exchange Servers, so knowing which one a person connects to helps me. I can't find an easy location in the registry, so I'm hoping there is a way to do it within VB.net code.

Thanks.
 
I know that if they use outlook and their outlook is open you can figure out this information. Other than that, you could find all of the exchange servers that are running on their network. But to figure out which one they need you would have to use mind reading or something that I do not know about.
 
Rather than looking on the local computer, I would look at Active Directory.

So query AD, find the user and look up their exchange server from there. I don't recall the exact property name, but you can look in Adsiedit to find the property in AD.

Let me know if you'd like some code to query AD.
 
I found that I can look at the registry and get the exchange server name. Now I'm trying to figure out how to pull a list of the Outlook folders and their folder size to put into a ListView. Any ideas?
 
I think that the answer depends largely in part to what version of Outlook you are using. I can't find any quick solution to this, however, I seem to recall that your answer may involve looping through a folder, item-by-item, and tallying up the size like that. Kinda ghetto, but outlook doesn't particularly care for code interacting with it.
 
Active Directory has a list of all exchange servers in the domain at this location

CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=<Exchange Environment name>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<Domain Name>,DC=<Domain Extension>

Where <Exchange Environment Name> is the name of your exchange environment
Where <Domain Name> is the name of your domain
Where <Domain Extension> is the name of the domain extension (usually "local")

Use the ADSIEdit.msc to find specific properties that you are looking for.
http://www.computerperformance.co.uk/w2k3/utilities/adsi_edit.htm
 
Try this perhaps it will step you in the right direction.

Dim Exch = GetObject("LDAP://CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=<Exchange Environment name>,CN=Microsoft _ Exchange,CN=Services,CN=Configuration,DC=<Domain Name>,DC=<Domain Extension>")

Dim Server

For Each Server in Exch
MessageBox.Show(Server.Name)
Next

If you are looking to get specifically which server your mailbox is located on that is a lot more complicated I believe.

If you are looking for more info then let me know.
 
Back
Top