Monthly Archives: September 2025

Unable to find type [short] Set-OrganizationConfig -RejectDirectSend $true

If you don’t have a valid use of DirectSend in Exchange Online, Microsoft recommends that you disable it with this Exchange Online PowerShell cmdlet below. This is a follow-up post to our previous post “An improved approach to blocking Direct Send Abuse.”

Set-OrganizationConfig -RejectDirectSend $true

If you experience an error message “Unable to find type [short]” then it is likely related to your version of PowerShell.  TL;DR you need to upgrade to version 7.

Steps to Fix:

  1. Install PowerShell 7 (latest version recommended – 7.4.0 or later)
  2. Open PowerShell 7 (not Windows PowerShell)
    • Look for “PowerShell 7” in your Start menu
    • It will show “PS” instead of “Windows PowerShell” in the title bar
  3. Install/Update the Exchange Online Management module in PowerShell 7:
  4. Install-Module -Name ExchangeOnlineManagement -Force -Scope CurrentUser
  5. Connect to Exchange Online:
  6. Connect-ExchangeOnline
  7. Run your Set-OrganizationConfig command – it should work now!

Why This Happens

The type “uint” (and “short”) is not built into Windows PowerShell 5.1, but these types are available in PowerShell 7. When the Exchange Online Management module tries to use these types in its internal code, Windows PowerShell 5.1 can’t find them, resulting in the TypeNotFound error.