Discussion:
how to programatoically get exchange server name
(too old to reply)
Ashish
2009-06-03 11:05:50 UTC
Permalink
If there are multiple exchange servers(single domain) then how to get its
exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.

GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
Lee Derbyshire [MVP]
2009-06-03 15:20:47 UTC
Permalink
Post by Ashish
If there are multiple exchange servers(single domain) then how to get its
exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.
GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
You could try getting it from the Configuration/Services/Microsoft Exchange
section of AD.

Lee.
--
______________________________________

Outlook Web Access For PDA , OWA For WAP
www.leederbyshire.com
lee a.t leederbyshire d.o.t c.o.m
______________________________________
Ashish
2009-06-04 07:16:33 UTC
Permalink
is there any example available for this or how to access
Configuration/Services
Post by Lee Derbyshire [MVP]
Post by Ashish
If there are multiple exchange servers(single domain) then how to get its
exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.
GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
You could try getting it from the Configuration/Services/Microsoft
Exchange section of AD.
Lee.
--
______________________________________
Outlook Web Access For PDA , OWA For WAP
www.leederbyshire.com
lee a.t leederbyshire d.o.t c.o.m
______________________________________
Lee Derbyshire [MVP]
2009-06-04 12:35:00 UTC
Permalink
Try putting this (but containing your own domain name) in a .vbs file, and
double-clicking it:


Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "SELECT Name FROM 'LDAP://CN=Administrative
Groups,CN=First Organization,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=yourdomain,DC=com' WHERE
objectClass='msExchExchangeServer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
WScript.Echo"Server Name: " & objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
Post by Ashish
is there any example available for this or how to access
Configuration/Services
Post by Lee Derbyshire [MVP]
Post by Ashish
If there are multiple exchange servers(single domain) then how to get
its exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.
GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
You could try getting it from the Configuration/Services/Microsoft
Exchange section of AD.
Lee.
--
______________________________________
Outlook Web Access For PDA , OWA For WAP
www.leederbyshire.com
lee a.t leederbyshire d.o.t c.o.m
______________________________________
Lee Derbyshire [MVP]
2009-06-04 12:35:00 UTC
Permalink
Try putting this (but containing your own domain name) in a .vbs file, and
double-clicking it:


Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = "SELECT Name FROM 'LDAP://CN=Administrative
Groups,CN=First Organization,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=yourdomain,DC=com' WHERE
objectClass='msExchExchangeServer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
WScript.Echo"Server Name: " & objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
Post by Ashish
is there any example available for this or how to access
Configuration/Services
Post by Lee Derbyshire [MVP]
Post by Ashish
If there are multiple exchange servers(single domain) then how to get
its exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.
GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
You could try getting it from the Configuration/Services/Microsoft
Exchange section of AD.
Lee.
--
______________________________________
Outlook Web Access For PDA , OWA For WAP
www.leederbyshire.com
lee a.t leederbyshire d.o.t c.o.m
______________________________________
kelly
2009-06-05 14:53:32 UTC
Permalink
Post by Ashish
If there are multiple exchange servers(single domain) then how to get its
exchange server name for each machine?
Suppose machine1 has exchange server1, machine2 has exchange server2 etc
then how to get exchange server1 on machine1.
GetComputerName returns exchange server name. But in cluster environment
exchange server name is different from machine name
try get-exchangeserver in powershell after you have installed the
exchange tools. That will give you all the exchanges servers in the
cluster.

Kelly
Loading...