troubleshooting Question

Powershell: Offboarding Script

Avatar of Isaias Perez
Isaias PerezFlag for United States of America asked on
PowershellIT AdministrationMicrosoft OfficeMicrosoft 365
1 Comment1 Solution95 ViewsLast Modified:
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.
Isaias Perez
IT Operations Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros