Creating demo users in Active Directory

For a task at work I had to create a number of users in Active Directory for a demo environment I had to set up. I didn’t really want to do this manually, and I wanted something more realistic than ‘DemoUser 01’, ‘DemoUser 02’ and so on.

I found an online API to generate random, but realistic user data, and decided to create a wrapper function to quickly get user data.

I then created a simple script to use this data to create demo users in Active Directory. I thought this might be of interest to others, so decided to share it here on my blog.

The code could probably be more polished, but as this was for a demo environment I decided that this would be enough. If you take my code and improve on it, please let me know! 🙂

First the wrapper function to get user data from randomuser.me.

This is the code that I used to create the demo users.

Unfortunately the password returned with the API is not always strong enough for Active Directory, so I decided to hard code it. These are demo users so having the same password for all users isn’t an issue.

I hope this have been helpful. Please leave any comments below.

3 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s