Файловый менеджер - Редактировать - /var/opt/nydus/ops/customer_local_ops/operating_system/powershell/change_password.ps1
Назад
param([Parameter(Mandatory)] [String] $userName) $passwordBase64 = Read-Host $password = [System.Text.Encoding]::UTF8.GetString( [System.Convert]::FromBase64String($passwordBase64)) if(Get-WmiObject -query "SELECT * FROM Win32_UserAccount where LocalAccount='True' and name = '$userName'"){ $user = [ADSI]"WinNT://$($env:COMPUTERNAME)/$userName,user" try{ $user.SetPassword($password) $user.SetInfo() }catch{ $errorMessage=$_.Exception.Message $errorMessage if($errorMessage -like "*Passwords may not contain the user's samAccountName *"){ throw $_.Exception.Message }elseif($errorMessage -like "*The password does not meet the password policy requirements.*"){ $errorMessage secedit /export /cfg c:\secpol.cfg (gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY rm -force c:\secpol.cfg -confirm:$false $user.SetPassword($password) $user.SetInfo() secedit /export /cfg c:\secpol.cfg (gc C:\secpol.cfg).replace("PasswordComplexity = 0", "PasswordComplexity = 1") | Out-File C:\secpol.cfg secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY rm -force c:\secpol.cfg -confirm:$false } } }else{ "User does not exist: $userName" exit 1 }
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка