Photo by leonides ruvalcabar / Unsplash
Solving the [uint] Error with New-HostedOutboundSpamFilterPolicy in ExchangeOnlineManagement

Solving the [uint] Error with New-HostedOutboundSpamFilterPolicy in ExchangeOnlineManagement

Published on 18 Jul 2024

Bastien Perez
Bastien Perez

Clap

If you've been working with some versions of ExchangeOnlineManagement, you might have encountered an issue with the New-HostedOutboundSpamFilterPolicy CMDlet. Specifically, you may receive the following error:

unable to find type [uint]

This error persists across different module versions, including ExchangeOnlineManagement 3.4.0 and 3.4.1. After some troubleshooting, I discovered the root of the problem: the default PowerShell version shipped with Windows 10/11 (PowerShell 5.1).

When I switched to PowerShell 7, the CMDlet executed without any issues. This clearly indicates that the problem lies within PowerShell 5.1. By upgrading to PowerShell 7, you can avoid this and similar issues.

While PowerShell 5.1 can lead to unexpected issues, PowerShell 7 offers improved performance, new features, and better compatibility. The best part? You can run PowerShell 5.1 and PowerShell 7 side-by-side. Make the move to PowerShell 7 today for a more reliable and efficient scripting experience.

Comments

banner-Bastien Perez
Bastien Perez

Freelance Microsoft 365 - Active Directory - Modern Workplace

France