Forum Discussion
MS Graph (or alternative) for M365/O365 Retention Policy management
- Jan 25, 2022
Good news guys!
Our request just got updated!
Check it out: https://m365log.com/apps-365/certificate-based-authentication-for-security-and-compliance-center-powershell/
Jhosefer , svermaak_MGL , dgal73 , Victor_Ivanidze Hi all,
I forgot to share something that was provided to me by Chris D on GitHub (I think, but sort of forget) MS Support. Right now, the Connect-IPPSSession which supports certificate based app-only authentication is only within the preview modules 2.0.6***. If we want to accomplish the same thing, but using the current GA 2.0.5, we can use Connect-ExchangeOnline and simply supply the -ConnectionUri parameter with the URL to the SCC:
Connect-ExchangeOnline -AppId e3de3805-2f5a-43c7-8541-b448b50936f4 -Organization MyTenant.onmicrosoft.com -Certificate (Get-ChildItem cert:\CurrentUser\My\98556EEAC704460287C809AEDA9CD3A33A9CAA9B) -ConnectionUri 'https://ps.compliance.protection.outlook.com'
... and it works flawlessly! I can't find this documented as supported, however, I do feel better using this approach in production scripts for clients, vs using the prerelease module versions. Hope you find it helpful!
How is something like this not documented anywhere?
Anyway, thank you very much! I will update our scripts today.
- JeremyTBradshawAug 24, 2022Steel Contributor
Jhosefer I think the main reason it's not documented is that it's still up in the air as to what will be the path forward (i.e., this solution I've shared, vs keeping/updating Connect-IPPSSession alive as its own cmdlet vs demoting it to be just an alias of the Connect-ExchangeOnline cmdlet). I'm definitely speculating here and do not have the internal answers but from my poking and prodding here and over on GitHub, it's my best guess.
In another GitHub issue, Chris also pointed out this same trick, while it works with the preview 2.0.6*** versions, since those versions default to non-RPS, we have to supply the -UseRPSSession switch. So again, not quite ready to be documented while things are in between current GA and final target state.