Exchange 2016 Troubleshooting: Event ID 2004 - MSExchange Management Application
Issue
In Exchange 2016 or even Exchange 2019, when you run cmdlets like Get-TransportServer you will receive a nice yellow warning to use the newer cmdlets.
Root cause
So Get-TransportServer has changed to Get-TransportService.
Troubleshooting
If you head over to the event logs, the application log, you will notice that if you have a script that runs you will receive a warning each time and Event ID 2004 will log as shown below:
Event viewer message
A script made a call into deprecated cmdlet "Get-TransportServer". This script must be updated to call into Get-TransportService instead.
Screenshot
https://everything-powershell.com/wp-content/uploads/2021/01/image-3.png
Coexistence
If you are running coexistence with Exchange 2010, obviously the script will use the older commands.
However if you are running Exchange 2016 or Exchange 2019 without coexistence then you should update your scripts to use the newer commands.
Important
Remember you only have the mailbox role in the newer versions of Exchange and everything else is a service now.