Book Image

Windows Server 2016 Cookbook

By : Jordan Krause
Book Image

Windows Server 2016 Cookbook

By: Jordan Krause

Overview of this book

This hands-on Cookbook is stuffed full of practical recipes that will help you handle the essential administrative tasks in Windows Server 2016. You’ll start by familiarizing yourself with the look and feel of Windows Server 2016, and will then learn how to navigate through some daily tasks using the graphical interface. You will see how to compose optimal Group Policies and facilitate task automation with PowerShell 5.0 scripting. We will also take a look at the functions available to provide remote network access to your traveling users, and explore the much anticipated Nano Server and Hyper-V built-in integration support that is brand new in Windows Server 2016. By the end of this book, you will know how to take your Windows Server 2016-powered server and turn it into any common infrastructure role that might be required in your company.
Table of Contents (18 chapters)
Windows Server 2016 Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Using PowerShell to create a new Active Directory user


Creating new user accounts in Active Directory is pretty standard stuff, but doing it the traditional way requires a lot of mouse clicks. Since we know that PowerShell can be used to accomplish anything within Windows Server 2016, but not many people actually employ it regularly, let's use this common task as a recipe to be accomplished with PowerShell rather than the GUI.

Getting ready

We will use PowerShell on our Windows Server 2016 DC in order to create this new user account.

How to do it…

Follow along to create a new user account in Active Directory by using the PowerShell command prompt:

  1. Launch a PowerShell command prompt as an Administrator.

  2. Enter the following command in order to create a new user account with very simple parameters:

    New-ADUser -Name "John Smith" -UserPrincipalName
          "[email protected]" -SamAccountName "jsmith"
    

  3. If you open up the GUI for Active Directory Users and Computers, you will see that John Smith...