Sandbox sample submitted by
Find Orphan mail files, check the Out of Office agent owner and the Calendar Profile owner of mail file for existing users.
There are three parts to this database:
1. Check the Out Of Office Agent: Here you can determine which agents are not signed by the databases' owner
2. Check the Calendar Profile: Similarly, find out which mail files have a Calendar Profile owner which is not the database owner
3. Find Orphan Mail files: Use this code to determine which mail file in the mail directory belong to users who no longer work in the company or have moved to another area of your company
All three might require some modifications to work properly in your environment