Administering Windows Server Hybrid Core Infrastructure (AZ-800) Practice

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the AZ-800 exam with our comprehensive study resources. Utilize flashcards and multiple-choice questions with hints and explanations. Gain confidence and excel in your certification journey!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which PowerShell command could you use to add a user?

  1. Get-ADUser

  2. New-ADUser

  3. Set-ADUser

  4. Remove-ADUser

The correct answer is: New-ADUser

The correct choice, "New-ADUser," is the appropriate PowerShell command for adding a new user to Active Directory. This cmdlet is specifically designed to create a new user account in an Active Directory environment. When using it, you can specify various attributes for the user, such as their name, username, password, and other properties that are relevant to the user account being created. For example, a typical command might look like this: ```powershell New-ADUser -Name "John Doe" -GivenName "John" -Surname "Doe" -SamAccountName "jdoe" -UserPrincipalName "jdoe@example.com" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true ``` In this example, the command creates a new user called John Doe with a specified username and other essential details, enabling the account in the process. The other commands mentioned are not used for adding users. "Get-ADUser" is for retrieving existing user details, "Set-ADUser" is for modifying the properties of an existing user, and "Remove-ADUser" is employed to delete users from Active Directory.