Troubleshoot New-AntiPhishPolicy PowerShell Parameter Errors
Question details
The user needs to resolve an issue where the New-AntiPhishPolicy cmdlet rejects certain parameters during script automation.

- Product
- Exchange Online Protection
- Device & OS
- not provided
- Scenario
- Automating Exchange Online Protection configurations using PowerShell scripts.
- Observed behavior
- The New-AntiPhishPolicy cmdlet rejects specific parameters, resulting in an unrecognized parameter error and causing the automation script to fail.
Ensure you have active global administrator or Exchange administrator permissions in your Microsoft 365 tenant and a stable internet connection before running Exchange Online PowerShell cmdlets.
Verify Module Version and Supported Parameters
Check your Exchange Online PowerShell module version and review the available cmdlet parameters to ensure compatibility with your script.
PowerShell cmdlets are frequently updated in Exchange Online. If you are using an older version of the ExchangeOnlineManagement module, recently introduced parameters for New-AntiPhishPolicy will not be recognized. Additionally, certain parameters are restricted based on your exact administrative role.
Open your PowerShell console as an administrator and run the 'Connect-ExchangeOnline' command to authenticate into your Microsoft 365 tenant.
Execute 'Get-Module -Name ExchangeOnlineManagement' to check your current module version. If it is outdated, run 'Update-Module -Name ExchangeOnlineManagement' to install the newest version.
Run 'Get-Help New-AntiPhishPolicy -Detailed' to view the exact list of parameters supported by your currently installed module and permission level.

Consult the Microsoft PowerShell Community
If parameters remain unrecognized after updating your module, gather the error logs and escalate the issue to the community.
Need a Reliable Office Suite for Your Admin Documentation? Try WPS Office
While managing Exchange Online Protection requires specialized Microsoft administration tools, writing your IT documentation, analyzing PowerShell script outputs in spreadsheets, or preparing security presentations doesn't have to cost extra. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office.
- 1. Download the installer: Visit the official WPS Office website and click the Free Download button for your operating system.
- 2. Install the software: Run the downloaded installer and follow the simple on-screen instructions to complete the setup.
- 3. Open and edit your admin reports: Launch WPS Office to immediately start analyzing your PowerShell output CSV files or updating your IT documentation.

Frequently Asked Questions
Why does a PowerShell parameter work in one tenant but not another?
Parameter availability can vary based on the specific Exchange Online release ring of the tenant, differences in the installed module versions across machines, or the specific administrative permissions granted to the executing account.
How do I update my Exchange Online PowerShell module?
Open an elevated PowerShell prompt as an administrator and execute the command 'Update-Module -Name ExchangeOnlineManagement'. If prompted, confirm the installation from the PSGallery.
Can I run New-AntiPhishPolicy without being a Global Admin?
Yes, but you must be assigned appropriate administrative roles, such as Organization Management or Security Administrator, within Exchange Online or the Microsoft 365 Defender portal to create or modify anti-phishing policies.




