//_blog

When a Contractor Comes Back: Warden's snapshot, strip, and restore

Joe is the Salesforce admin at Brewtiful Beans. On Friday afternoon, a ticket lands in his queue: Riley’s seasonal contract ends today. Remove Salesforce access before the weekend.

Joe knows how to deactivate a user. The harder question is what happens if the team needs Riley back. A few weeks later, they do: one integration needs a handoff, and Riley is returning for two weeks. Joe now needs to reinstate the account without guessing at the permission sets, groups, and queues Riley had.

That’s the small lifecycle gap Warden’s snapshot, strip, and restore commands are built to cover.

Save the state before changing it

If Joe wants a point-in-time record without changing Riley’s account, he can run snapshot:

sf warden snapshot \
  --user 'Username:riley.contractor@brewtifulbeans.example' \
  --out snapshots/riley-before-change.json \
  --target-org BrewtifulBeans

Warden records whether the user is active or frozen and captures assignments such as permission sets, permission set groups, public groups, queues, and permission set licenses. The snapshot uses developer/API names for those assignments, which makes it portable between orgs when the referenced assignments exist there.

For Joe’s Friday offboarding, he can have strip create the snapshot as part of the same operation. First, he checks the proposed plan:

sf warden strip \
  --user 'Username:riley.contractor@brewtifulbeans.example' \
  --target-org BrewtifulBeans \
  --dry-run

Then he runs the strip and saves the pre-strip state:

sf warden strip \
  --user 'Username:riley.contractor@brewtifulbeans.example' \
  --snapshot snapshots/riley-offboarding.json \
  --target-org BrewtifulBeans

In full-user mode, strip freezes the user, removes access assignments, and deactivates the account. Warden writes the snapshot before it applies those org changes. The --snapshot file is also written when --dry-run is set, even though a dry run makes no org changes.

There is another strip mode worth keeping distinct. With --persona or --all-personas, Warden removes only the selected persona-derived access. Shared grants remain, and freezing or deactivating is off unless Joe asks for it with --freeze or --deactivate. For a departing contractor whose whole account should be shut down, Joe leaves those persona flags out.

Bring Riley back without guessing

When the integration needs its handoff, Joe can inspect what Warden would do with the saved snapshot:

sf warden restore \
  --snapshot snapshots/riley-offboarding.json \
  --target-org BrewtifulBeans \
  --dry-run

After reviewing the plan, he runs the same command without --dry-run to apply it.

restore resolves the user again by the snapshot’s match key, reactivates and unfreezes the account, and adds assignments that are missing. It does not remove assignments Riley already has. That makes restore a useful way to recover the saved access, but not a command for making current access exactly match the old snapshot. Warden reports profile and role details for reference; it does not apply them as part of restore. If those values need to change, Joe handles them separately.

That distinction matters after a few weeks back in Salesforce. Riley may have picked up access needed for the integration, and an additive restore won’t silently take that away. Joe still reviews the dry-run output and the final result, especially if the snapshot is going to a different org where an assignment might not exist.

The useful habit is simple: when a change could be hard to reconstruct, save a snapshot first. When the change is a full offboarding, strip --snapshot connects the record to the action. And when a person returns, restore --dry-run gives Joe a chance to see the plan before applying it.

Warden is a Salesforce CLI plugin for user lifecycle administration:

Install it with:

sf plugins install @syntax-syllogism/warden