0
0
PowerShellscripting~20 mins

Organizational unit operations in PowerShell - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
OU Operations Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of Creating a New OU
What is the output of this PowerShell command when creating a new Organizational Unit (OU) named 'Sales' in the domain 'example.com'?
PowerShell
New-ADOrganizationalUnit -Name "Sales" -Path "DC=example,DC=com"
A
DistinguishedName : OU=Sales,DC=example,DC=com
Name              : Sales
ObjectClass       : organizationalUnit
BNew-ADOrganizationalUnit : Access is denied.
CThe term 'New-ADOrganizationalUnit' is not recognized as the name of a cmdlet.
DOU 'Sales' created successfully with no output.
Attempts:
2 left
💡 Hint
Think about what the cmdlet returns when it successfully creates an OU.
💻 Command Output
intermediate
2:00remaining
Result of Removing an OU with Child Objects
What happens when you run this command to remove an OU that contains child objects without using the -Recursive flag?
PowerShell
Remove-ADOrganizationalUnit -Identity "OU=Marketing,DC=example,DC=com"
AThe command runs silently with no output.
BOU 'Marketing' and all child objects removed successfully.
COU 'Marketing' removed successfully, child objects moved to parent OU.
DRemove-ADOrganizationalUnit : Cannot delete object because it has child objects.
Attempts:
2 left
💡 Hint
Think about how Active Directory handles deletion of containers with children.
🔧 Debug
advanced
2:00remaining
Identify the Error in OU Move Script
This script attempts to move an OU named 'HR' to a new parent OU 'Departments'. What error will it produce?
PowerShell
Move-ADObject -Identity "OU=HR,DC=example,DC=com" -TargetPath "OU=Departments,DC=example,DC=com"
AThe OU 'HR' is moved successfully with no output.
BMove-ADObject : Access is denied.
CMove-ADObject : The specified target path is invalid or does not exist.
DMove-ADObject : The identity parameter is missing or invalid.
Attempts:
2 left
💡 Hint
Check if the parameters are correctly specified and the target OU exists.
📝 Syntax
advanced
2:00remaining
Syntax Error in OU Creation Script
Which option contains a syntax error when creating an OU named 'Finance'?
ANew-ADOrganizationalUnit -Name "Finance" -Path "DC=example,DC=com"
BNew-ADOrganizationalUnit -Name Finance -Path DC=example,DC=com
CNew-ADOrganizationalUnit -Name "Finance" -Path "DC=example,DC=com" -Description "Finance OU"
DNew-ADOrganizationalUnit -Name "Finance" -Path "DC=example,DC=com" -ProtectedFromAccidentalDeletion $true
Attempts:
2 left
💡 Hint
Look for missing quotes or incorrect parameter formats.
🚀 Application
expert
3:00remaining
Script to List All OUs Recursively
Which script correctly lists all Organizational Units recursively under the domain 'example.com'?
AGet-ADOrganizationalUnit -Filter * -SearchBase "DC=example,DC=com"
BGet-ADOrganizationalUnit -Filter * -SearchBase "DC=example,DC=com" -SearchScope OneLevel
CGet-ADOrganizationalUnit -Filter * -SearchBase "DC=example,DC=com" -SearchScope Subtree
DGet-ADOrganizationalUnit -Filter * -SearchBase "OU=example,DC=com" -SearchScope Subtree
Attempts:
2 left
💡 Hint
Consider the SearchScope parameter to include all nested OUs.