Avatar of Isaias Perez
Isaias Perez
Flag for United States of America

asked on 

Powershell: Offboarding Script

I am looking to develop a powershell script that can process off-boarding for my team. We have a Hybrid On-Prem/Office 365 Environment.  I would like it to do the following:

For the On-Prem side:
  • Disable the AD Object
  • Put Date and Time Object was disabled in the Description Field in the AD Object
  • Remove all AD Memberships (Except Domain User) ***If possible create a log of that users memberships somewhere so we can revert back if need be.
  • Move Object to the _Disabled OU

For the Office 365 side:
  1. Block Sign-in
  2. Force out any logged in Session (optional)
  3. Remove All O365 Licenses
  4. Convert Mailbox to Shared Mailbox

Thank you very much on your assistance with this. We need this urgently as we have massive layoffs in our company. Thank you and Stay Safe.

Also please provide the Powershell Modules needed to complete these commands. Or do i need to run them from a domain controller or the exchange server. Thanks.
PowershellIT AdministrationMicrosoft OfficeMicrosoft 365

Avatar of undefined
Last Comment
Isaias Perez

8/22/2022 - Mon