Hello everyone,
I want to change administrator password via batch file or via ps1 file. But I want 2 important things:
not show new password via message box;
nobody read this batch file.
Please help me. Thanks.
Hello everyone,
I want to change administrator password via batch file or via ps1 file. But I want 2 important things:
not show new password via message box;
nobody read this batch file.
Please help me. Thanks.
Where the password will come from ?
Someone will type it manually ?
If so,
$Password = Read-Host -AsSecureString
$UserAccount = Get-LocalUser -Name "User02"
$UserAccount | Set-LocalUser -Password $Password
For the file, if you want to restrict people from reading it, juste remove Users group from the NTFS permissions and only keep the user that will run the batch to be able to read the file.
I want to type username and password in the script and anyone click this script automatically change administrator password. Automatically confirmation. Not ask me yes or no. Nobody see administrator's password and nobody can change this script. Can I explain?
Hi,
I recommend you to avoid using script to change the local administrator account. Using the script you cannot ensure that the password is different on each server.
I recommend you to deploy LAPS Local Administrator Password Solution. This solution is free and let you save the password in secure location : a protected attribute in active directory. To have more details about this solution , you can read the following articles:
Microsoft LAPS usage
Local Administrator Password Solution
Please don't forget to mark helpful reply as answer
15 people are following this question.