EASYENTRA

Knowledge Base

How to Decommission a User via PowerShell

Use case: Use this procedure when you need to offboard a hybrid or cloud-only user in a consistent and repeatable way, for example during employee departures or account clean-up tasks. Automating the process via PowerShell allows you to schedule the process, run it in bulk, and couple it with additional steps to further customize the process.

To decommission a user via PowerShell, use one of the built-in cmdlets:

Hybrid users

Invoke-EEDecommissionHybridUser [-Identity] <string> [-Domain <string>]

Entra ID users

Invoke-EEDecommissionEntraUser [-Identity] <string> [-Tenant <string>]

  • Start a PowerShell 7 command prompt using the same credentials you use to run EasyEntra.
    • The cmdlet reads decommission settings and credentials from the EasyEntra configuration file stored in the Windows user profile.
  • Modify the decommission settings by offboarding a user in the EasyEntra GUI or by manually editing the configuration file.
  • Review the output after the process completes, either manually or programmatically.
    • The overall completion status is available in the Status property [Completed | CompletedWithWarning | CompletedWithError | FatalError]
    • The decommission settings used to guide the process are available in the DecommissionSettings property of the result.
    • A detailed task log is available in the TaskLog property of the result.

To schedule the process, ensure the scheduled task runs in the security context of a user account with a local user profile that holds the EasyEntra configuration and authentication.

Ensure that the scheduled task is protected, allowing only authorized personnel to modify job settings.

How to decommission a hybrid user using PowerShell and EasyEntra

Additional PowerShell Cmdlets

EasyEntra includes additional PowerShell cmdlets for common administrative tasks.
To view the complete list of available PowerShell cmdlets, open Settings in EasyEntra.

Related Articles

ID:KB_112_HowtodecommissionahybriduserviaPowerShell