0
0
PowerShellscripting~30 mins

New-ADUser and Set-ADUser in PowerShell - Mini Project: Build & Apply

Choose your learning style9 modes available
Create and Update Active Directory Users with PowerShell
📖 Scenario: You are an IT administrator managing user accounts in an Active Directory (AD) environment. You need to create new user accounts and update their properties using PowerShell commands.
🎯 Goal: Learn how to create a new AD user with New-ADUser and update user properties with Set-ADUser using PowerShell.
📋 What You'll Learn
Create a new AD user with specific properties using New-ADUser
Set a password for the new user
Enable the new user account
Update the user's office location using Set-ADUser
Display the updated user properties
💡 Why This Matters
🌍 Real World
IT administrators often need to automate user account creation and updates in Active Directory to save time and reduce errors.
💼 Career
Knowledge of New-ADUser and Set-ADUser commands is essential for system administrators managing Windows networks and Active Directory.
Progress0 / 4 steps
1
Create a new AD user with basic properties
Create a new AD user with the username jdoe, given name John, surname Doe, and user principal name jdoe@example.com using New-ADUser. Use the -AccountPassword parameter with a secure string password P@ssw0rd123 and set -Enabled to $false initially.
PowerShell
Need a hint?

Use ConvertTo-SecureString to create a secure password string for -AccountPassword.

2
Enable the user account
Create a variable called $username and set it to jdoe. Then enable the user account by running Set-ADUser with the -Enabled $true parameter for the user with SamAccountName $username.
PowerShell
Need a hint?

Use Set-ADUser -Identity $username -Enabled $true to enable the user.

3
Update the user's office location
Use Set-ADUser to update the office location of the user with SamAccountName $username to Headquarters. Use the -Office parameter.
PowerShell
Need a hint?

Use Set-ADUser -Identity $username -Office "Headquarters" to update the office location.

4
Display the updated user properties
Use Get-ADUser with the -Identity $username parameter and -Properties Office to get the user details. Then print the user's name and office location using Write-Output in the format: User: John Doe, Office: Headquarters.
PowerShell
Need a hint?

Use Get-ADUser -Identity $username -Properties Office to get the user, then print with Write-Output.