<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #45160 Issue and fix: https://www.youtube.com/watch?v=Ow9GAFedEnQ # Checklist for submitter ## Testing - [x] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Enhanced error handling in the admin user creation process to ensure immediate failure on errors, preventing incomplete operations during user account creation or group membership assignment. [](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/45176) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
11 lines
539 B
PowerShell
11 lines
539 B
PowerShell
# Please don't delete. This script is referenced in the guide here: https://fleetdm.com/guides/enforce-disk-encryption
|
|
|
|
$Username = "IT admin"
|
|
$Password = ConvertTo-SecureString "StrongPassword123!" -AsPlainText -Force
|
|
|
|
# Create the local user account
|
|
New-LocalUser -Name $Username -Password $Password -FullName "Fleet IT admin" -Description "Fleet breakglass admin account" -AccountNeverExpires -ErrorAction Stop
|
|
|
|
# Add the user to the Administrators group
|
|
Add-LocalGroupMember -Group "Administrators" -Member $Username -ErrorAction Stop
|