# Preview OU-based account actions

Preview OU-based account actions on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

PSAutomator

This PowerShell Module is new approach to onboarding, offboarding and business as usual processes running in companies infrastructure.

[View on GitHub](https://github.com/EvotecIT/PSAutomator) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSAutomator/releases) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSAutomator)

Stars**73**

Forks**16**

Open issues**0**

PowerShell Gallery downloads**5328**

Release**v0.0.3**

Language: PowerShell Updated: 2024-12-22

Curated Examples

Use PSAutomator to model an OU-triggered account workflow with WhatIf actions.

This pattern is useful when you want to review how a trigger and actions fit together before changing accounts.

It is adapted from `Examples/RunBook.UsersOffboarding.1.ps1`.

## Example

```powershell
Import-Module PSAutomator
Import-Module PSSharedGoods

Service -Name 'Active Directory Prepare Users' {
    Trigger -Name 'Offboarded users OU' -User OrganizationalUnit -Value 'OU=Users-Offboarded,OU=Accounts,DC=corp,DC=example,DC=com' |
        Condition |
        Action -Name 'Disable users' -ActiveDirectory AccountDisable -WhatIf |
        Action -Name 'Add to disabled users group' -ActiveDirectory AccountAddGroupsSpecific -Value 'Disabled Users' -WhatIf
}
```

## What this demonstrates

- modeling an OU-based trigger
- chaining account actions
- keeping changes in preview mode with `-WhatIf`

## Source

- [RunBook.UsersOffboarding.1.ps1](https://github.com/EvotecIT/PSAutomator/blob/master/Examples/RunBook.UsersOffboarding.1.ps1)

<!-- PowerForge markdown artifact sha256:F89F8C52777245DB1AA51BA293CDC75FCA63A36B9F78F7A4848D9BE68BE6510D -->
