How to setup MailinaBox on Azure

I just discovered Mailinabox, such amazing work.
I’m reasonably experienced with Azure and have an MSDN license so get free credit so decided to pop it up there.
I wrote a Powershell script that makes the MIAB server up for you with little effort required, so just making aware in case it’s of use.
I also did a companion blog piece with some instructions and specific stuff related to Azure and Namecheap and the script I wrote.
Hopefully it can be of use to someone else.



Hey not bad, but in order to make sure everything is done correctly, you should wrap those commands in try-catch’s in the event something cannot be done and return the user’s Azure to a working state.

Otherwise, nice script my friend!

Thanks !
What do you mean though sorry ?
With Azure because the Powershell is basically just modifying the underlying JSON errors rarely seen to matter but happy to take suggestions or a pull !
Coming from a MS exclusive background FOSS ways of working are foreign but am trying to give back !

In powershell a try-catch looks like:

$Users = Get-Content C:\temp\usersimport.txt

foreach ($User in $Users) { 
    try { 
        Get-ADUser -Identity $User | Out-Null 
        Write-Output "$user exists" 
    catch { 
        write-output "$User doesn't exist" 

Notice the “catch{” part of the script will do stuff when an error occurs, like inform the user of something, or reverse changes, etc,etc.

Ahh i see yes I didn’t bother with error handling but it’s a good shout for v 2 . Tbh I’ll probably look at json template instead

1 Like

Error 404 - Not Found

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.