RSS

Tag Archives: Office365

Change synchronization interval for published calendars in Office 365

By default a subscribed ics. calendar from Office 365 contains calendars entries that range from -3 months to +6 months. If you want to publish a calendar on which subscribing users will see a yearly overview this time range is far too short. Therefore, listing calendar entries for the next half-year only is not ideal. The solution to this problem is to change the synchronization settings of Office 365 for the published calendar in such a way that the subscribed calendar synchronizes entries up to one year. This can be achieved using the PowerShell:

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

if you execute the following command you will see:

Get-MailboxCalendarFolder -identity "MailboxName:NameOfCalendar"

RunspaceId : xxx
Identity : MailboxName:NameOfCalendar
PublishEnabled : True
PublishDateRangeFrom : ThreeMonths
PublishDateRangeTo : SixMonths
DetailLevel : FullDetails
SearchableUrlEnabled : False
PublishedCalendarUrl : http://outlook.office365.com/owa/calendar/xxx/calendar.html
PublishedICalUrl : http://outlook.office365.com/owa/calendar/xxx/calendar.ics
IsValid : True
ObjectState : Unchanged

To update the PublishDateRangeTo to OneYear — which is the largest value — just execute following command:

Set-MailboxCalendarFolder -identity "MailboxName:NameOfCalendar" -PublishDateRangeTo OneYear

Now, by executing following command again you will see the change of the PublishDateRangeTo value

Get-MailboxCalendarFolder -identity "MailboxName:NameOfCalendar"

RunspaceId : xxx
Identity : MailboxName:NameOfCalendar
PublishEnabled : True
PublishDateRangeFrom : ThreeMonths
PublishDateRangeTo : OneYear
DetailLevel : FullDetails
SearchableUrlEnabled : False
PublishedCalendarUrl : http://outlook.office365.com/owa/calendar/xxx/calendar.html
PublishedICalUrl : http://outlook.office365.com/owa/calendar/xxx/calendar.ics
IsValid : True
ObjectState : Unchanged

At the end do not forget to close the session:

Remove-PSSession $Session

Possible Error messages:

It may be that you encounter following error:

Import-PSSession : Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.

This is because your ExecutionPolicies are set to Rescricted. To change this type following command into the PowerShell with elevated rights.

Set-ExecutionPolicy RemoteSigned
Advertisements
 
1 Comment

Posted by on February 5, 2015 in Uncategorized

 

Tags: