Forum Discussion
PaddyB
Dec 25, 2021Copper Contributor
PowerShell for Leaver
Hi all Merry XMAS to you all how you guys handle leavers? so employees what are leaving the company? I'm looking for a good PowerShell to make my life much easier... my idea right now is...
VasilMichev
Dec 26, 2021MVP
PowerShell is still the best tool for this, IMO. Errors can be fixed, even with the quirks of Remote PowerShell, you have sufficient tools for proper error handling. Most of the steps you mentioned above are simple oneliners, and the expected result can be verified easy, so if needed you can retry a given step. For the ones that are more complicated, such as remove from all Groups, you will need a proper, full-blown script and some testing to make sure you've addressed all the peculiarities in your specific environment. Here's one such script I wrote a while back: https://www.michev.info/Blog/Post/2161/script-to-remove-users-from-all-groups-in-office-365