Today I will explain, how we can monitor the SharePoint servers without much human interaction.
Table of Contents:
- Example of use case
- Description about the script
- Summarize – what we had here?
Sometimes we want to automate the SharePoint repeating monitoring task – like want to monitor the SharePoint and windows services which are relevant to SharePoint environment. In this tutorial we’ll see which area of monitoring we can automate it.
Example of use case:
Lets say some of the application is not working which has dependency with the workflow – to be more specific the certain file has to move one place to another place automatically thru the retention policy timer job, this is just an example but there are various scenario on timer job and most of the automation is handled in SharePoint thru the background job – i.e. Timer Job. So we know the importance of Timer Job service and if this service gets stopped automatically due to some reason – then think what will happen to our application. Here I have just exampled as timer job service but there are many important other services too, those SharePoint administrator periodically need to monitor to keep the server healthy.
Description about the script:
This script will give complete details about the SharePoint servers with the various color model and will start the mandatory services if any of the services are stopped automatically!!!,Refer the ReadMe.txt attached file for deployment guide.
For now I have coded this to handle three servers, but certainly it can be extended to handle multiple servers dynamically…need to extend the code. This ServerReports.ps1 can be configured as a windows task scheduler job, so that everyday morning we can get automatic email to the configured email id with colorful status in html table format. If server has serious issue and need your attention then the particular row/service will be displayed in red color with the proper description and if just warning color will be yellow, if everything fine then color will be lime green.
Not only color coding – if any of the mandatory services from any of the configured server stopped automatically due to some issue, the code will restart those services and if some issue related to timer job, the code also will restart the timer services to fix that issue – these actions are well described in the email report. More or less I can say we can get the complete details (what went well or wrong) about all servers in last 24 hours. I am sure like me you will also be benefited with this report.
Summarize – what we had here?
Thus, we saw the real time use cases of SharePoint server automation script.
Click here to download the script.