Rename user using PowerShell function call
This commit is contained in:
parent
cdf07a5d54
commit
1f82f78c7f
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ function New-PersonalUser([Context] $context)
|
|||
}
|
||||
|
||||
Write-Information "Renaming the new User to $($context.UserName)";
|
||||
wmic useraccount where "name='$user'" rename "$context.UserName";
|
||||
Rename-LocalUser $user $context.UserName;
|
||||
Add-LocalGroupMember -Group "Administrators" -Member $user && Set-LocalUser $context.AdminName -Password (ConvertTo-SecureString -AsPlainText "Admin");
|
||||
|
||||
Write-Host "Registering setup script for all new users";
|
||||
|
|
Loading…
Reference in a new issue