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

Question: 1 / 400

Which PowerShell command could you use to add a user?

Get-ADUser

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.

Get further explanation with Examzify DeepDiveBeta

Set-ADUser

Remove-ADUser

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy