I'm adding a ressource mailbox to a new AD ressource (user) and configure it after with the following commands (as you see I'm handing over the domain controller server name that I don't have to wait for the AD syncronisation):
$mailbox = Enable-Mailbox $pUserid -Database $mailboxStats[0].Name -DomainController $pDcServer -Room -ErrorAction Stop $mailbox | Add-MailboxPermission -User XX\XXXXX -AccessRights FullAccess -DomainController $pDcServer -ErrorAction Stop $mailbox | Add-ADPermission -User XX\XXXXX -Extendedrights "send as" -DomainController $pDcServer -ErrorAction Stop $mailbox | Set-CalendarProcessing -AutomateProcessing AutoAccept -DomainController $pDcServer -ErrorAction Stop
The configurations are just an example of the different commands I'm using to configure the mailbox after creating it.
I had to wait up to 300 seconds after Enable-Mailbox until the Set-CalendarProcessing command returned successfully, before I alway get the following error:
Cannot open mailbox /o=XXXXXXXXX/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=XXXXXXXXX/cn=Microsoft System Attendant.This is not the ressource mailbox I'm handing over to the command, this looks like an administrative mailbox of the exchange server.
Is it really needed to wait that long that the mailbox is ready? Is there a possibility to get rid of the waiting time or to know when the mailbox is ready?