First off, backups are the solution to this - don't let important things be stored locally. (Not that it matters, the new hires always like to reinvent the wheel.)
However, a bunch of things need to be solved from an HR perspective. You need to make a checklist for HR on how to handle IT things. Things like, "Get the PIN code to their iPhone" or "Make sure social media accounts have documented passwords" that'll make your life easier.) Basically you have 6 different situations:
- Senior/Upper Management - resigns - be nice. If some knowledge might be needed later, HR should have a policy to hire that person on a consulting/1099 basis if needed. Even if they're disgruntled, it should make them happy to hear that. Treat them with respect, cut off IT access as early and quickly as possible, but realistically that probably means their last day. Get their laptop and phone (if its not BYOD) their last day and check and double check accounts (VPN, Dropbox) they might have set up.
- Senior/Upper Management - fired - be careful. If you're terminating senior management and they've been there a while, you need to specifically ask HR if they're going to be malicious. They probably won't (I've never run into it), but cut off account access immediately and redirect emails to somewhere appropriate. Tell HR that severance needs to be withheld until you know things are ok if you think it's appropriate.
- IT staff - resigns - be nice. I always like to try to treat them like I would senior management. I've hired many a former employee on a 1099 basis later.
- IT staff - fired - be paranoid. Ok, this is where you do everything BEFORE HR sits down with them. Accounts cut off, especially remote access, change admin passwords, etc. Have them go clean something the hour before you all them in and quietly take care of it all. When a regular employee quits, you don't worry about them walking into the lobby later with a laptop loaded up with vSphere Client and wirelessly deleting VM's. Check backups.
- Staff - resigns - be nice. If you can handle the situations above, you can handle this. I agree with the other post about cutting off access as quickly as possible - take away shared Inboxes, etc.
- Staff - fired - be careful. Get the laptop and phone, turn off access.
I remember working with a telecom guy who installed a campus wide fiber network. When he was terminated I was slightly concerned he was going to take a pair of boltcutters to a fiber ped.