Pulling ical (sharing) links from 365 mailboxes
I did this for a dashboard originally, and then also did it to sync my personal calendar to Nextcloud. It is a nice long list of commands but relatively straight forward.
To start a session set your execution policy and provide credentials. The credentials are your full email and password. As far as I can tell, this is a universal section that doesn't need to be modified.
Set-ExecutionPolicy RemoteSigned $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
The next session is where you get your URLs from, you need to substitute
Calendar for your target user and calendar name (Calendar is default). This also generates an HTML link, it is a pretty display.
Import-PSSession $Session Set-MailboxCalendarFolder firstname.lastname@example.org:\Calendar -PublishEnabled $true Set-MailboxCalendarFolder -DetailLevel fulldetail -identity email@example.com:\Calendar Get-MailboxCalendarFolder firstname.lastname@example.org:\Calendar | fl