During OS Deployment it's not entirely uncommon to see organizations renaming the local admin directly in the task sequence. There are many options available for doing so, but using a healthy dose of PowerShell is an effective way. 🙂
Using the Rename-LocalUser Cmdlet
Below sample gets hold of the local administrator account from its well-known SID, and then renames that account by piping the object to the Rename-LocalUser cmdlet.
$NewAdminName = "Demo1"
Get-LocalUser | Where-Object { $_.SID -like "S-1-5-*-500" } | Rename-LocalUser -NewName $NewAdminName
Simply add the above script to your task sequence, no need for a package, but don't forget to set the PowerShell execution policy to Bypass.
