Create local users with random passwords in Window Server
I recently worked on a project where I had to write a script to create local users and add them to groups in Windows Server 2003. It was for VMWare’s vSphere software. It uses local groups and users as users of the center, and allows you to assign privileges with these. Creating these users and assigning them to groups is easy with a simple script:
The follow script does a few things:
- Creates multiple users with similar names (user1, user2, user3)
- Generates a password of random numbers, upper and lowercase letters
- Assigns the users to a group (the group must exist before using the script)
- Stores the generated usernames and passwords to a text file

