Maintenance mode
From MoodleDocs
The idea of maintenance mode is to prevent any users other than admin to use the system (Moodle) while maintenance process takes place.
So basically when students/guests/teachers try access a course in maintenance mode, they will get a notification saying the course is in maintenance mode. You can also add customized message from the Admin>>Maintenance page (probably mentioning when the site will go back online or the reason for doing maintenance). While, Admin can access all the normal functionalities and do the necessary maintenance task.