同步Office365日历到第三方网站

同步Office365日历到第三方网站

 

随着云计算的成熟,越来越多学校选择把自己的主页运营在云端服务器上,这样可以大量的节省IT的运营成本,国际学校的网页服务器大部分运维在godaddy,Finalsite,Azure等的主流服务器上。如何把Office365的日历同步到自己的网站上就变得非常重要了。今天就拿我们学校拿作为例子来讲解一下。因为默认的情况下,O365的日历只可以同步90天的数据到云端。需要我们用powershell去修改默认配置到1年,才能把整个学年的日历同步上去,要注意的是,即使用命令还改,貌似最多就是能同步一年的日历而已。

现在就让我们试一下该怎么去把Office365的日历同步时间段由90天变成一年吧:

  1. 以管理员身份卡开powershell. 输入以下命令,运用Office365的管理员账号登陆控制平台.

$UserCredential = Get-Credential

A screenshot of a cell phone

Description automatically generated

2. 输入以下命令登陆你们的Exchange Online 平台.

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

A screenshot of a cell phone

Description automatically generated

3. 导入模块。

Import-PSSession $Session

A screenshot of a cell phone

Description automatically generated

4. 使用下面的命令来确认你所需要修改的同步日历的同步时间段.

Get-MailboxCalendarFolder -Identity [email protected]:\Calendar |fl

Or

Get-MailboxCalendarFolder -Identity [email protected]:\calendar |fl publishedcalendarurl

A screenshot of a cell phone

Description automatically generated

5.  通过命令行,你可以看到现在我的日历是还没有共享的,另外时间段是默认的3个月.

A screenshot of a cell phone

Description automatically generated

6. 通过下面的命令把同步时间段修改为一年.

Set-MailboxCalendarFolder -Identity [email protected]:\calendar –PublishEnabled $true -PublishDateRangeFrom OneYear -PublishDateRangeTo OneYear

A screenshot of a cell phone

Description automatically generated

7. 运行命令还再次确认同步日历的同步时间.

Get-MailboxCalendarFolder -Identity [email protected]:\Calendar |fl

Or

Get-MailboxCalendarFolder -Identity [email protected]:\calendar |fl publishedcalendarurl

A screenshot of a cell phone

Description automatically generated

如果你想更加多的了解关于日历同步的详细信息,你可以点击下面的链接:

https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/set-mailboxcalendarfolder?view=exchange-ps