Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.
If the script mentioned by Crystal-MSFT isn't working for you, there could be several reasons why:
- User account control: UAC can interfere with the execution of PowerShell scripts and prevent you from changing the local admin password. Try running the script as an administrator.
- Permissions: Ensure that the account you are using to run the script has the necessary permissions to change the local admin password.
- Execution policy: The execution policy in PowerShell can prevent scripts from running. You can check the current execution policy by running the following command: Get-ExecutionPolicy. You can set the execution policy to "Unrestricted" by running the following command: Set-ExecutionPolicy Unrestricted.
- Syntax: Ensure that the script syntax is correct and that you are using the correct syntax for the version of PowerShell you are running.
It's also a good idea to double-check the script and make sure it's suitable for your needs and requirements.
If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.