# Exchange PowerShell - Publish Room / Equipment Calendars


So you've got some resource (rooms/equipment) calendars in Exchange that you need to make the calendars public for. You can use PowerShell to accomplish this quite easily.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1706035550379/d8a40bdf-1231-48c2-a503-3d2827c6d757.png)

<!--truncate-->

First of all you can get the current calendar publishing information by using the **[Get-MailboxCalendarFolder](https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailboxcalendarfolder?view=exchange-ps)** cmdlet:

```powershell
Get-MailboxCalendarFolder -Identity VIRT-V01:\\Calendar
```

Note that if the mailbox's language is not English (GB/US/etc) then you will need to change the **:\\Calendar** suffix to the relevant one.

All the relevant calendar publishing information is then displayed:

```
RunspaceId                      : 2a27a1b5-42d1-4700-bd25-713b4892d960
Identity                        : VIRT - V.01 (10):\\Calendar
PublishEnabled                  : False
PublishDateRangeFrom            : SixMonths
PublishDateRangeTo              : SixMonths
DetailLevel                     : FullDetails
SearchableUrlEnabled            : False
PublishedCalendarUrl            :
PublishedICalUrl                :
ExtendedFolderFlags             : SharedOut, SharedViaExchange, ExchangeShareFolder, ExchangePublishedCalendar
ExtendedFolderFlags2            :
CalendarSharingFolderFlags      : None
CalendarSharingOwnerSmtpAddress :
CalendarSharingPermissionLevel  : Null
SharingLevelOfDetails           : None
SharingPermissionFlags          : None
SharingOwnerRemoteFolderId      : AAA=
LastAttemptedSyncTime           : 01/02/0001 00:00:00
LastSuccessfulSyncTime          : 01/02/0001 00:00:00
CreationTime                    : 02/11/2019 08:07:31
DelegateInformation             : Delegate Information was not calculated.
DefaultOnlineMeetingProvider    : TeamsForBusiness
AllowedOnlineMeetingProviders   : {TeamsForBusiness}
IsValid                         : True
ObjectState                     : Changed
```

You can see that publishing is disabled (PublishEnabled = false) and that the calendar url (PublishedCalendarUrl) and iCal (PublishedICalUrl) feed are empty.

To **enable publishing** you need to use the **[Set-MailboxCalendarFolder](https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/set-mailboxcalendarfolder?view=exchange-ps)** cmdlet.

```powershell
Set-MailboxCalendarFolder -Identity VIRT-V01:\\Calendar -PublishEnabled $true -DetailLevel Full -PublishDateRangeFrom SixMonths -PublishDateRangeTo SixMonths
```

This will publish the calendar and make the past and future six months of events visible with full information available. You can execute the **Get-MailboxCalendarFolder** cmdlet again to retrieve the urls.

PublishedCalendarUrl : https://outlook.office365.com/owa/calendar/cecc3ccb3ba64d6fa3a4dc9c98d6122c@resources.test.com/51c0f0ee990d4428833b9fd521fa4f6217934636036240388081/calendar.html
PublishedICalUrl : https://outlook.office365.com/owa/calendar/cecc3ccb3ba64d6fa3a4dc9c98d6122c@resources.test.com/51c0f0ee990d4428833b9fd521fa4f6217934636036240388081/calendar.ics

If you decide to disable publishing, you can just execute the following:

```powershell
Set-MailboxCalendarFolder -Identity VIRT-V01:\\Calendar -PublishEnabled $false -ResetUrl
```

The **ResetUrl** switch will clear the url properties. This is entirely optional. If you decide to enable publishing again then new urls may be generated if ResetUrl was specified.

