Last active
September 27, 2018 18:47
-
-
Save ScriptingPro/6465b355ba77498389c92d0f1598ffd0 to your computer and use it in GitHub Desktop.
AD/ADSI/LDAP MSExchange related queries (without using Exchange Management Shell cmdlets)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get Exchange Servers | |
Get-ADObject -SearchBase $(Get-ADRootDSE).configurationNamingContext -Filter {objectCategory -eq "msExchExchangeServer"} | |
# Find well-known Exchange groups in Active Directory | |
Get-ADObject $(Get-ADRootDSE).configurationNamingContext -Filter {objectclass -eq "msExchConfigurationContainer"} -Properties otherwellKnownObjects | select -ExpandProperty otherwellKnownObjects | %{$_.Split(":")[-1]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment