I am in a position where I need to script changing some local user account passwords on our machines.
I have a script that can simply change the password of a set user account name e.g. JoeBloggs on a computer using the computername variable.
However, the acocunts that need their passwords changing are dynamically created by the software they are used with. Sophos.
The accounts use the format of:
SophosSAU<first 10 characters of computername> 0
e.g. For "VirusManagement" server, the user acocunt created would be: SophosSAUvirusmanag0
How do I get this variable in to a script so that I can simply run it on each machine (or via GPO) to change the passwords please? Attached is copy of the simple script mentioned above if its of any help to anyone in solving this.
So I am looking for a script to:
- Change the password of local user accounts
- Use the computername variable to locate the user account
- Find the correct user account based on Sopho's user naming convention above
Many, many thanks in advance.