Hello,
I have a sheduled task running.
This task checks if a user is a member of a Licensed Office 365 Group with exchange online.
If the user does not have an exchange mailbox it should create the on premise mailbox and the remote mailbox.
Everything is working but if the user is created, the user is in the licensed group and in that moment an ad sync is running the user recieves automatically an exchange online mailbox.
If my script runs to late he will not recieve an on premise mailbox because of course he alredy has an exchange online mailbox.
Doy you know what I can add to check if a user only has exchange online mailbox it should also create also the on premise mailbox?
This is the powershell script:
$session = New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri http://namexxx/PowerShell/
Import-PSSession $session -DisableNameChecking -Prefix MySession
Enable-MySessionRemoteMailbox "%username%" -remoteroutingaddress "%username%@namexxx.mail.onmicrosoft.com"
Remove-PSSession $session
Should I insted use the adaxes office 365 licensing?
If I give a user a Exchange Online license does it automatically create the on prem exchange mailbox and the exchange online mailbox?
Thanks if you have an idea!