0
0
PowerShellscripting~10 mins

Organizational unit operations in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new organizational unit named 'Sales' in Active Directory.

PowerShell
New-ADOrganizationalUnit -Name [1]
Drag options to blanks, or click blank then click option'
A'Finance'
B'Marketing'
C'Sales'
D'HR'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the name in quotes.
Using an incorrect parameter name.
2fill in blank
medium

Complete the code to move the organizational unit 'Sales' to the path 'OU=Departments,DC=example,DC=com'.

PowerShell
Move-ADObject -Identity 'OU=Sales,DC=example,DC=com' -TargetPath [1]
Drag options to blanks, or click blank then click option'
A'OU=Departments,DC=example,DC=com'
B'OU=Teams,DC=example,DC=com'
C'OU=Users,DC=example,DC=com'
D'OU=Groups,DC=example,DC=com'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong distinguished name for the target path.
Omitting quotes around the path.
3fill in blank
hard

Fix the error in the code to delete the organizational unit 'Sales' including all child objects.

PowerShell
Remove-ADOrganizationalUnit -Identity [1] -Recursive
Drag options to blanks, or click blank then click option'
A'OU=Sales,DC=example,DC=com'
B'OU=Marketing,DC=example,DC=com'
C'Sales'
D'OU=Finance,DC=example,DC=com'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the OU name without the full path.
Forgetting the -Recursive switch when child objects exist.
4fill in blank
hard

Fill both blanks to get all organizational units under 'OU=Departments,DC=example,DC=com' and select their names.

PowerShell
Get-ADOrganizationalUnit -Filter * -SearchBase [1] | Select-Object [2]
Drag options to blanks, or click blank then click option'
A'OU=Departments,DC=example,DC=com'
BName
CDistinguishedName
DDescription
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong distinguished name in -SearchBase.
Selecting a property that does not exist or is not useful.
5fill in blank
hard

Fill all three blanks to create a new OU named 'HR' in 'OU=Departments,DC=example,DC=com' and set a description.

PowerShell
New-ADOrganizationalUnit -Name [1] -Path [2] -Description [3]
Drag options to blanks, or click blank then click option'
A'HR'
B'OU=Departments,DC=example,DC=com'
C'Human Resources Department'
D'Finance Department'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the description text.
Using the wrong path for the -Path parameter.