O'Reilly logo

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition by Thomas Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

This recipe uses some AD cmdlets contained in the ActiveDirectory module. The recipe shows how to do basic management of AD objects using PowerShell.

In step 1, you create a hash table of common user properties. You use this hash table to hold some of the common user properties. There is no output from this step.

In step 2, you add two users to the AD. Note that the parameters to New-ADUser include the properties set in the $NewUserHT hash table and the parameters you specify when you call New-ADUser. Note that, by default, the Add-NewADUser adds the new user into the the Users container in the root of the AD. There is no output from this step, although you can observe the two newly added users using the Active Directory Users ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required