In my article about Autodiscover and calendar Availability you can find all prerequisites for calendar availability from architectural perspective. In this article I will explain how to configure this feature after all prerequisites have been deployed.
Cross-organisation availability
In the Source-Organisation (On-Prem)

Add-AvailabilityAddressSpace -ForestName ahorner.co.at -AccessMethod OrgWideFB -Credential (Get-Credential)

If you run this command in Exchange-Online you will get this error:
Write-ErrorMessage :Microsoft.Exchange.Configuration.Tasks.InvalidOperationInDehydratedContextException|The command
you tried to run isn't currently allowed in your organization. To run this command, you first need to run the command:
Enable-OrganizationCustomization.
At C:\Users\netadmin\AppData\Local\Temp\2\tmpEXO_lstqomk3.jqf\tmpEXO_lstqomk3.jqf.psm1:1099 char:13
+ Write-ErrorMessage $ErrorObject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-AvailabilityAddressSpace], InvalidOperatio...ontextException
+ FullyQualifiedErrorId : [Server=VI1PR09MB4143,RequestId=3831f332-87a9-039e-b637-21e8a126b099,TimeStamp=Tue, 06 D
ec 2022 13:04:10 GMT],Write-ErrorMessage
So w need to run this command
Enable-OrganizationCustomization

If you run this command again
Add-AvailabilityAddressSpace -ForestName ahorner.co.at -AccessMethod OrgWideFB -Credential (Get-Credential)
You will get this error:
Write-ErrorMessage : |Microsoft.Exchange.Configuration.Tasks.ThrowTerminatingErrorException|The Target Autodiscover
Endpoint must be specified.
At C:\Users\netadmin\AppData\Local\Temp\2\tmpEXO_lstqomk3.jqf\tmpEXO_lstqomk3.jqf.psm1:1099 char:13
+ Write-ErrorMessage $ErrorObject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-AvailabilityAddressSpace], ThrowTerminatingErrorException
+ FullyQualifiedErrorId : [Server=VI1PR09MB4143,RequestId=1a382f31-77f2-b412-6457-2f614b693ae8,TimeStamp=Tue, 06 D
ec 2022 13:25:28 GMT],Write-ErrorMessage
If you run this command:
Add-AvailabilityAddressSpace -ForestName ahorner.co.at -AccessMethod OrgWideFB -TargetAutodiscoverEpr https://autodiscover.ahorner.co.at/EWS/Exchange.asmx -Credentials (Get-Credential)
You will get this error:
Write-ErrorMessage : Ex574388|Microsoft.Exchange.Configuration.Tasks.TaskException|The parent object for could not be
found. Please check that promtechgroup.onmicrosoft.com\Availability Configuration exists.
At C:\Users\netadmin\AppData\Local\Temp\2\tmpEXO_lstqomk3.jqf\tmpEXO_lstqomk3.jqf.psm1:1099 char:13
+ Write-ErrorMessage $ErrorObject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-AvailabilityAddressSpace], TaskException
+ FullyQualifiedErrorId : [Server=VI1PR09MB4143,RequestId=dff41263-9cec-0bf5-19c1-de3484a9556a,TimeStamp=Tue, 06 D
ec 2022 13:28:20 GMT],Write-ErrorMessage
The Solution
We need to create Organisation-Availability config
New-AvailabilityConfig –OrgWideAccount admin@ahorner.co.at
Name : Availability Configuration
PerUserAccount :
OrgWideAccount : Admin
AdminDisplayName :
ExchangeVersion : 0.1 (8.0.535.0)
DistinguishedName : CN=Availability Configuration,CN=Configuration,CN=ahorner.onmicrosoft.com,CN=Configurati
onUnits,DC=EURPR09A006,DC=PROD,DC=OUTLOOK,DC=COM
Identity : Availability Configuration
ObjectCategory : EURPR09A006.PROD.OUTLOOK.COM/Configuration/Schema/ms-Exch-Availability-Config
ObjectClass : {top, container, msExchAvailabilityConfig}
WhenChanged : 06.12.2022 14:36:35
WhenCreated : 06.12.2022 14:36:35
WhenChangedUTC : 06.12.2022 13:36:35
WhenCreatedUTC : 06.12.2022 13:36:35
ExchangeObjectId : c9262b34-6132-47a9-9da8-50b416c0f757
OrganizationalUnitRoot : ahorner.onmicrosoft.com
OrganizationId : EURPR09A006.PROD.OUTLOOK.COM/Microsoft Exchange Hosted
Organizations/promtechgroup.onmicrosoft.com -
EURPR09A006.PROD.OUTLOOK.COM/ConfigurationUnits/promtechgroup.onmicrosoft.com/Configuration
Id : Availability Configuration
Guid : c9262b34-6132-47a9-9da8-50b416c0f757
OriginatingServer : AM0PR09A06DC001.EURPR09A006.PROD.OUTLOOK.COM
IsValid : True
ObjectState : Unchanged
Run this command again:
Add-AvailabilityAddressSpace -ForestName ahorner.co.at -AccessMethod OrgWideFB -TargetAutodiscoverEpr https://autodiscover.ahorner.co.at/EWS/Exchange.asmx -Credentials (Get-Credential)
Add-AvailabilityAddressSpace -ForestName mccloud.cloud -AccessMethod OrgWideFB -TargetAutodiscoverEpr https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc/WSSecurity -Credentials (Get-Credential)

The command was now successful.
Now we need the same configuration in the other direction
New-IntraOrganizationConnector -Name Tomccloud.cloud -TargetAddressDomains mccloud.cloud -DiscoveryEndpoint https://autodiscover.mccloud.cloud/EWS/Exchange.asmx
New-IntraOrganizationConnector -Name Tomccloud.cloud -TargetAddressDomains mccloud.cloud -DiscoveryEndpoint https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc/WSSecurity
If you have additional questions, just reach out to me.
I hope you have enjoyed this demystification article.
If you have any questions just leave me a feedback.

Leave a Reply