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 Ashishis there any example available for this or how to access
Configuration/Services
Post by Lee Derbyshire [MVP]Post by AshishIf 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
______________________________________