Skip to Main Content
Microsoft® Windows PowerShell™ Step By Step
book

Microsoft® Windows PowerShell™ Step By Step

by Ed Wilson
May 2007
Beginner content levelBeginner
320 pages
8h 23m
English
Microsoft Press
Content preview from Microsoft® Windows PowerShell™ Step By Step

Creating User Accounts: Step-by-Step Exercises

In this exercise, we will explore the use of Windows PowerShell to create several users whose names are contained in a text file.

  1. Open Notepad or some other Windows PowerShell script editor.

  2. Locate the UserNames.txt file, and ensure you have access to the path to this file. The file contains a listing of users' first and last names. A sample from this file is shown here:

    Chuck,Adams
    Alice,Jones
    Bob,Dentworth
  3. On the first line of your script, create a variable called $aryUsers to hold the array of text that is returned by using the Get-Content cmdlet to read a text file that contains various user first names and last names. Make sure you edit the string that gets supplied to the path argument of the

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows PowerShell™ 3.0 Step by Step

Windows PowerShell™ 3.0 Step by Step

Ed Wilson
Windows PowerShell® 2.0 Bible

Windows PowerShell® 2.0 Bible

Thomas Lee, Karl Mitschke, Mark E. Schill, Tome Tanasovski
Windows Server® 2008 Active Directory® Resource Kit

Windows Server® 2008 Active Directory® Resource Kit

Conan Kezema Stan Riemer Mike Mulcare, Byron Wright, and Microsoft Active Directory

Publisher Resources

ISBN: 9780735623958Catalog PageErrataSupplemental Content