Coder Social home page Coder Social logo

0emma0 / new-labusers.ps1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cunninghamp/new-labusers.ps1

0.0 0.0 0.0 8 KB

PowerShell script to generate user accounts in Active Directory for a test lab environment

License: MIT License

PowerShell 100.00%

new-labusers.ps1's Introduction

New-LabUsers.ps1

PowerShell script to populate Active Directory in a test lab environment with user accounts.

This script relies on the Active Directory PowerShell module. If you are running it on your test lab domain controller the module should already be present and the script should work. I have tested the script on Windows Server 2012 R2 only at this stage.

Parameters

All parameters are optional. The script will default to use:

  • The input file RandomNameList.txt
  • Password length of 16 characters
  • Top-level OU of "Company"

Use the script parameters if you need to change those values:

  • InputFileName - Use this parameter if you need to specify a different text file name containing the list of users. A generated list of names is also provided with the script so that you can see the format required.
  • PasswordLength - Use this parameter if you need to specify a different password length. By default all the user accounts are created with a randomly generated password that is 16 characters long. You can reset the password for any user that you want to log on with.
  • OU - Use this parameter if you want to name the top-level OU something different than the default name of "Company".

Examples

Uses the RandomNameList.txt file to generate the list of user accounts in an OU called "Company" in Active Directory.

.\New-LabUsers.ps1

Uses the MyNames.txt file to generate the list of user accounts in an OU called "TestLab" in Active Directory.

.\New-LabUsers.ps1 -InputFileName .\MyNames.txt -PasswordLength 8 -OU TestLab

Credits

Written by: Paul Cunningham

Find me on:

Check out my books and courses to learn more about Office 365 and Exchange Server.

Additional credits:

Random Password Generator function from Scripting Guys blog post http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/03/generating-a-new-password-with-windows-powershell.aspx

Random name list generated from http://listofrandomnames.com

new-labusers.ps1's People

Contributors

cunninghamp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.