Checking Drive Space Volumes for DAG DB members through PowerShell

I had received a weird alert for a DB volume for a DAG member being below threshold. This was odd to me due to the fact that there were four DAG members and we only received an alert for one. I went into Azure Log Analytics and ran the following query to render a graph for the past 14 days showing the percent free space of the volume for all the DAG members.

Thanks Georges Moua for the query script!

Now the reason I can run the query this way is due to the fact that the Design of the DAG was correctly done and the DB folders are identical on all DAG members. The query rendered the following chart:

As you can see the Green DAG member is way below the other DAG members.

I next went to an Exchange Server in the DAG and got the volume data for all the members in the DAG:

EX02’s volume free space is far below the other DAG members

I went on EX02 and found that there was a subfolder named “Restore” that was not present on the other servers. I ran the following script to get the size of that folder in GB:

The folder size was 185 GB. Removing that folder, along with all subfolders/files, would balance the free space to the other DAG members. I ran the following cmdlet to remove the folder and all subfolders/files:

This remediated the alert and balanced the drive space across all DAG members.


Check the Crawl Status of a SharePoint Farm

A lot of times in my job, we get alerts for processor usage spikes and memory being below threshold for normal server usage. When these would occur on SharePoint servers, I would go through finding out what processes were running that were using a lot of processor and memory. Turns out that it was usually noderunner.exe that was causing the issue which has to deal with the crawl function of the SharePoint data being indexed by the servers in the farm. So, after looking around on a few sites, I compiled the following ps1 script that can be run on a SharePoint server to get the Crawling status of all the SharePoint Content Sites and how long it took to crawl during the prior cycle:

It will output:
– The name of the Content Site being Crawled
– Whether or not the crawl is idle
– If idle, when the crawl started
– If the last crawl took three hours or less

I hope this will give some help to those deep diving into SharePoint Performance.