Looking to fix or repair a broken Intune tunnel, in this particular example both of the servers were showing as server off-line, even though the host was online and active.
If you navigate to this link: Tenant admin - Microsoft Intune admin center you will notice that the servers are offline or unhealthy.
Check the logs from intune
Click on one of the servers, this will show you this, and that tells you that the MDM thinks the server is offline:From there choose the "Logs" option and then generate a report for the last 7 days, then when you click generate you will be able to download the logs to see if there is anything helpful in them:
Reboot/Power Cycle?
Rebooting the server does not fix this particular problem as there’s a more fundamental failure going on here, therefore If you wish to try rebooting the server, you will notice that will fail, Furthermore, if you try to power off the server and power it back on again this will also fail - It’s not an Xbox.
Login and Password Maintanance 👮
These servers will listen on SSH, so connect to the using SSH, my weapon choice here is putty, if you have misplaced the username and password (Yes, it does happen) then find the virtual machine in your azure Subscription and find the “reset password” option - this will tell you what the username is, especially helpful if you have changed it from the default of “root”
Then in the reset password options, you will see the username which here is "crazyroot" so now you know the login and you can also set the new password if required:
SSH to server 👀
mstunnel_monitor
fail: Error executing ContainerStatus
/usr/sbin/mst-cli: line 1589: /etc/mstunnel/messages/out/LastError: Permission denied
fail: Error executing FailLogger
fail: Failed to start service mstunnel-agent service
You you can try to start it with this command:
sudo mst-cli server start
So once started if you try to query the service with this command, but that says its offline, weird:
sudo mst-cli server show status
Status: offline
sudo mst-cli server start
sudo mst-cli server show status
sudo mst-cli uninstall
This will then remove it :
info: Uninstalling...
When you click "Create" you will get two downloads, if this has worked before you really do not need the readiness tool but its good to check for sanity, and then you do need the script to install the service.....
Download those files and lets take a look, once downloaded I used winscp to transfer the files the users home directory, in this case the local user.....
chmod -x mst-readiness
Then you can run
./mst-readiness
./mst-readiness network
Then you can run
./mstunnel-setup
Remember you need to enter "yes" not "y" like I did - read the options correctly!
Then it will all the services and then leave you on the screen about the certificate used in conjunction with the tunnel as you can see below:
Then you need to move those files from the home folder to the correct directory with this
mv /home/crazyroot/site.crt /etc/mstunnel/certs/site.crt
Now the files are in place you can go back to your setup SSH session when you can press enter for it to continue:
Just before it complete you will get a request that says something like this:
This is where you need to load a browser and visit the website as above, and use the code you have been given in the box below:
You will need to be a Global Administrator or an Intune Administrator else you will get this error:
Error: You must be assigned to role 'Global administrator' or 'Intune administrator'
Shown below in all its glory:
Verify service is online and running
That will confirm its running and it will stay running.....
State: running
Then you can check this from the MDM portal and see the magic.
Monitoring for future downtime