Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Last active September 18, 2017 18:52
Show Gist options
  • Save MyITGuy/e2241b1ef476b3a1ebd358e6b84b0c0c to your computer and use it in GitHub Desktop.
Save MyITGuy/e2241b1ef476b3a1ebd358e6b84b0c0c to your computer and use it in GitHub Desktop.
PowerShell: Exchange Active Directory query by recipient type
Get-ADObject -Filter "objectCategory -eq 'person' -and objectClass -eq 'user' -and msExchRecipientDisplayType -bor 8 -and msExchRecipientTypeDetails -bor 32"
Get-QADObject * -LdapFilter "(objectCategory=person)(objectClass=user)(msExchRecipientDisplayType:1.2.840.113556.1.4.804:=8)(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=32)"
Get-ADObject -Filter "objectCategory -eq 'person' -and objectClass -eq 'user' -and msExchRecipientDisplayType -bor 7 -and msExchRecipientTypeDetails -bor 16"
Get-QADObject * -LdapFilter "(objectCategory=person)(objectClass=user)(msExchRecipientDisplayType:1.2.840.113556.1.4.804:=7)(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=16)"
Get-ADObject -Filter "objectCategory -eq 'person' -and objectClass -eq 'user' -and msExchRecipientDisplayType -bor 0 -and msExchRecipientTypeDetails -bor 4"
Get-QADObject * -LdapFilter "(objectCategory=person)(objectClass=user)(msExchRecipientDisplayType:1.2.840.113556.1.4.804:=0)(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=4)"
Get-ADObject -Filter "objectCategory -eq 'person' -and objectClass -eq 'user' -and msExchRecipientDisplayType -bor 1073741824 -and msExchRecipientTypeDetails -bor 1"
Get-QADObject * -LdapFilter "(objectCategory=person)(objectClass=user)(msExchRecipientDisplayType:1.2.840.113556.1.4.804:=1073741824)(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment