Computer configuration — Policies — Windows Settings — Scripts — Startup
Добавить скрипт PowerShell Scripts
Script Name: \\domain.ru\NETLOGON\newlocaladmin.ps1
Script Parameters: -ExecutionPolicy remotesigned -ExecutionPolicy Bypass -NonInteractive -NoProfile
newlocaladmin.ps1
1 2 3 4 5 |
$password = convertto—securestring «SuperStrongPassword!!!» —asplaintext —force Set—LocalUser —Name localadminuser —Password $password New—LocalUser —User localadminuser —Password $password —PasswordNeverExpires:$true —AccountNeverExpires:$true Add—LocalGroupMember —Group «Администраторы» —Member localadminuser Add—LocalGroupMember —Group «Administrators» —Member localadminuser |
Добавить комментарий