Pretty neat script I found on /r/sysadmin today:

The script queries a HR database to see if anything has changed (including resigned / terminated users) and sends an email to HR for confirmation if true.

From the reddit user:

 I have a PowerShell script that asks our HR database directly. Then sends an email if it finds anything not matching up. I find asking a computer more reliable than asking HR to remember to tell IT. It updates a few display fields too. Here is the sanitised gist.

Code: