How to: Clear Exchange 2013 / 2016 log files
With Exchange 2013 and especially 2016, Microsoft started logging more than in earlier versions. These logs are intended to help them if you call in with problems. However, it seems like the biggest problem is the space these logs can take up. Once your Exchange server gets below a certain amount of free space on the drive where logs are stored you will see mail queuing up due to back pressure, Event ID 15006.
Some research led me to a couple of solutions; I’m using one with a few tweaks that helped it to run in our environment.
NOTE: these are not the mail logs, please don’t fill the comments telling me that we shouldn’t manually delete any logs from Exchange lest we be visited by plagues of locusts, etc. These are performance and error logs, they can safely be manually deleted and must be, since they are not cleaned out automatically.