We can use the Active Directory schema attribute “msExchCurrentServerRoles” to determine the role installed on the server. You can use this attribute, if you want to find the server role information through LDAP instead of exchange powershell. This attribute resides on the exchange server objects that exists in the Configuration container. You can check it through ADSIEdit by selecting Configuration context as well known Naming Context.
CN=<Servername>,CN=Servers,CN=Exchange Administrative Group,CN=Administrative Groups,CN=<Organization name>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<Domain Name>,DC<com>
The attribute msExchCurrentServerRoles holds maskable integer value, it includes the following values.
Mailbox role – 2 Client Access role (CAS) – 4 Unified Messaging role – 16 Hub Transport role – 32 Edge Transport role – 64
Use the below LDAP filters to get exchange servers by filtering with exchange server role:
Mailbox role:
(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=2))
Client Access role (CAS):
(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=4))
Unified Messaging role:
(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=16))
Hub Transport role:
(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=32))
Edge Transport role:
(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=64))
Advertisement