Hello Techies.
in my environments, i have created two script to enable the mailboxes on both exchange on-prem servers and off365 mailboxes (Remote Mailboxes) . It is running in schedule task for every one hour
Below are the sample for on-prem
Get-User -OrganizationalUnit E2K16MBX | Where-Object {$.recipientType -eq "user" -and $.Company -eq "cloudnine"} | Enable-Mailbox -Database "DB01EX01"
Below are the sample to create remote Mailbox
$Users = Get-User -OrganizationalUnit Off365mbx | Where-Object {$.recipientType -eq "user" -and $.WindowsEmailAddress -like "$null" }
$users | % {Enable-RemoteMailbox -Identity $ -RemoteRoutingAddress((($.UserPrincipalName.split("@")[0])) +"@cloudnine.mail.onmicrosoft.com")}
i would like to create a single script to enable or to function the above needs. also there are scenario's where application mailboxes should not be create any type mailboxes either on-prem servers or Off365 mailboxes
meaning some exception to create any mailboxes in the OU's
could some help me on this