r/PowerShell • u/KavyaJune • Feb 17 '26
Your existing Exchange Online PowerShell scripts might fail
Microsoft is removing support for the -Credential parameter in new versions of the Exchange Online PowerShell module released after June 2026.
The -Credential parameter relies on ROPC (legacy authentication), which does not support MFA or Conditional Access. Because of this, Microsoft is removing support for it in future module releases.
If you’re using:
Connect-ExchangeOnline -Credential $credespecially in unattended scripts, those will need to be updated.
Alternatives:
- Interactive sign-in
- App-only authentication (recommended for automation)
- Managed Identity (for Azure automation)
65
Upvotes
14
u/bodobeers2 Feb 17 '26
Glad I switched to AzureAD app method of connecting, works like a charm with ManageAsApp.
2
u/Frequent-Sir-4253 Feb 17 '26
Is there a link to any announcement or documentation on this
2
u/daniellookman Feb 17 '26
Thanks for this post!
I've noticed that some very important scripts are connecting through this method. Time to authenticate them through an app registration.
1
u/vaaoid95 Feb 20 '26
Should I register an app for the module like "PS-EXO-ADMIN" or an app for each powershell script?
1
u/ilovechips_ Feb 19 '26
You should have moved your scripts to app auth ages ago. The next best time to do that is now. It's very easy to set it up, even with self signed certs
-1
u/Cadder Feb 17 '26
Ha! My EXO scripts already failed and got rewritten when M$oft insisted hybrid AD sites had to be managed via graph