# Examples

> Example remote scripts for *nix and Windows

---

Site [llms.txt](/llms.txt)

---

## Expire a user password

Expires the named user's password, so that the user must set a new one at next login. Replace `cbuser` with the account you want to expire.

```bash
#!/bin/bash
passwd --expire cbuser
```

## Join a Windows server to an OU

On a Windows server, this executes as PowerShell and joins the server to the given domain and organizational unit. Replace the domain, OU, and account values with your own.

```powershell
$domain = "example.com"
$ou = "ou=cb_users,dc=example,dc=com"
$duser = "EXAMPLE\Administrator"
$dpwd = "ReplaceWithPassword"
$creds = New-Object System.Management.Automation.PSCredential($duser, (ConvertTo-SecureString $dpwd -AsPlainText -Force))
Add-Computer -DomainName $domain -OUPath $ou -Credential $creds
```

<div class="alert alert-warning" role="alert">


This example holds a domain password in plain text to keep it short. In practice, supply the password as an action input rather than writing it into the script. See [Action input parameters](/docs/cmp/use/orchestration/actions/action-input-parameters/).
</div>


## Related

- [Write remote scripts](/docs/cmp/use/orchestration/remote-scripts/write/): shebangs, parameterization, and return codes.
- [OS-specific requirements](/docs/cmp/use/orchestration/remote-scripts/os-specific-requirements/): preparing the target server.
