Is it possible to pass the argument createmailbox to script?

We currently create Exchange Mailboxes from ARM and afterwards we do some changes via powershell script to those mailboxes.

This works absolutely fine but we have a problem when the user has no mailbox.

The Powershell Script is running anyway and  obviously creates errors, as the users mailbox can't be found because it doesn't exist.

How is it possible to pass the argument that no mailbox should be selected to a powershell script?

Thank you for your help

  • Hi lmu,

    have you tried just passing {createmailbox} to the script? In case that does not work the best option would probably be to just do a get-mailbox for the user in the script and only execute the rest of the code if a mailbox exists.