Complete the code to list all users in Active Directory.
Get-ADUser -Filter [1]The -Filter * parameter retrieves all users from Active Directory.
Complete the code to create a new Active Directory user named 'JohnDoe'.
New-ADUser -Name 'JohnDoe' -AccountPassword (ConvertTo-SecureString [1] -AsPlainText -Force) -Enabled $true
The password must be strong; 'Password!' meets complexity requirements.
Fix the error in the code to disable a user account named 'JaneSmith'.
Disable-ADAccount -Identity [1]The -Identity parameter requires the username as a string, so quotes are needed.
Fill both blanks to get all enabled users whose name starts with 'A'.
Get-ADUser -Filter "[1] -and Enabled -eq [2]"
The filter uses Name -like 'A*' to match names starting with 'A' and checks if Enabled is True.
Fill all three blanks to create a new user with a given name, surname, and enable the account.
New-ADUser -Name 'Alice Smith' -GivenName [1] -Surname [2] -AccountPassword (ConvertTo-SecureString 'Password!' -AsPlainText -Force) -Enabled [3]
Use 'Alice' for given name, 'Smith' for surname, and $true to enable the account.