Automation and Scripting
The Automation and Scripting domain tests how you repeat EUC operations safely with code and APIs. Questions cover PowerShell, shell scripting, REST APIs, scheduled tasks, infrastructure as code, idempotency, error handling, secrets management, logging, testing, and change control. The exam expects automation that is auditable and reversible, not clever one-liners.
Core rules
- Make scripts idempotent: running twice should produce the same state, not duplicate devices, groups, or policies.
- Fail loudly: use strict error handling, validate inputs, and return meaningful exit codes. Log what changed, for whom, and when.
- Keep secrets out of code. Use a vault, managed identity, or encrypted credential store; rotate and scope credentials.
- Test in a pilot group, support -WhatIf or dry-run where available, and record the change. Automation without change control becomes an outage multiplier.
Worked example
You must onboard 100 new laptops from a CSV. A loop calls the management API to create each device record, assign a group, and apply a compliance policy. The script reads the CSV, validates serial numbers, retries transient HTTP 429 responses with backoff, logs each result, and skips records already present. Reasoning: validation prevents bad data, retry handles rate limits, idempotency prevents duplicates, and logs provide an audit trail. A hardcoded admin password would fail the security test even if the loop worked.
Traps
Do not hardcode credentials. Do not ignore API rate limits. Do not run destructive commands without a target filter. Do not omit -ErrorAction Stop or equivalent and then assume success.