# Preview group-triggered disable workflow

Preview group-triggered disable workflow 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 preview a group-triggered account disable workflow.

This pattern is useful when group membership drives a directory action but conditions should be visible in the workflow definition.

It is adapted from `Examples/RunBook.UsersDisable.ps1`.

## Example

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

Service -Name 'Active Directory Disable Users in Group' {
    Trigger -Name 'Member of disabled users group' -User GroupMembership -Value 'Disabled Users' |
        Condition -Name 'Email is not service account domain' -Condition Field -Value @{
            Field = 'EmailAddress'
            Operator = 'notlike'
            Value = '*@service.example.com'
        } |
        Condition -Name 'Email address is present' -Condition EmptyOrNull -Value EmailAddress |
        Action -Name 'Disable users' -ActiveDirectory AccountDisable -WhatIf
}
```

## What this demonstrates

- using group membership as a trigger
- adding conditions before the account action
- keeping the action in preview mode

## Source

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

<!-- PowerForge markdown artifact sha256:9E6E583CB2B72366C333125F71DD29E12B21ABC43722E17E915E08E0F1BA76B1 -->
