# DeployR task-sequence customisation reference

Look up the optional DeployR task-sequence customisations recorded for computer naming, TPM clearing, disk preparation and timing. Their necessity is not established for every deployment.

!!!warning Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
!!!

## Set Computername

The source leaves this step's necessity uncertain when the Autopilot deployment profile already specifies a name. It records the following task-sequence option.

- In your task sequence Add a step and select Set Variable
- Select the new Set Variable step and rename it to Set Variable ComputerName on the Properties tab
- In Variable Name enter COMPUTERNAME
- In Variable Value enter \<PREFIX\>-%SerialNumber:-11%. E.g. COR-%SerialNumber:-11%
- This will create a PC name with the prefix COR- followed by the last 11 characters of the serial number. Important to note that the PC name still has to be 15 characters or less and can't contain any funky symbols.
- Move the step to the top of your task sequence.

## Clear TPM

Again this is not entirely necessary, but it is always nice to start with a pristine TPM so the new windows image can do its thing.

- In your task sequence Add a step in the Windows PE group and select Run Powershell Script
- Select the new Run Powershell Script step and rename it to Run Powershell TPM Clear on the Properties tab
- Ignore the Script Name
- In the Script section paste the following

``` powershell
Get-CimInstance -Namespace root/CIMV2/Security/MicrosoftTpm -ClassName Win32_Tpm | Invoke-CimMethod -MethodName Clear
```

- Click Save all changes.
- Move the step above the Format Disk step

## Diskpart Clean

Again, not absolutely necessary but sometimes it is nice to just start with a clean disk before applying anything new.

- In your task sequence Add a step in the Windows PE group and select Run Powershell Script
- Select the new Run Powershell Script step and rename it to Run Powershell Diskpart Clean on the Properties tab
- Ignore the Script Name
- In the Script section paste the following

``` powershell
$diskpartScript = @"
```

select disk 0

clean

"@

\$diskpartScript \| diskpart

- Click Save all changes.
- Move the step above the Format Disk step

## Change PROGRESSTIMEOUT

At the end of the imaging process, prior to the last reboot, DeployR will wait for around 3 minutes before timing out and doing the final reboot and cleanup. This can be changed by changing a variable at the very start of the task sequence.

The final reboot cleans up all DeployR local content and runs sysprep, and after reboot it boots to OOBE and Autopilot. Changing the timeout to a short value simply speeds up the process.

- In your task sequence Add a step and select Set Variable
- Select the new Set Variable step and rename it to Set Variable PROGRESSTIMEOUT on the Properties tab
- In Variable Name enter PROGRESSTIMEOUT
- In Variable Value enter the number of seconds before timing out. The captured example uses 5 seconds.

## Related guidance

- [Topic overview](Introduction.md)
- [Source review status](../../review/Review-status.md)
