API Reference
Command
Remove-ADXOrganizationalUnit
Removes an Active Directory organizational unit.
Examples
Example 1: Preview the removal of an empty decommissioned OU
Remove-ADXOrganizationalUnit -Identity 'OU=Legacy-Print,OU=Servers,DC=contoso,DC=com' -WhatIf
Example 2: Remove a lab OU recursively during environment cleanup
Remove-ADXOrganizationalUnit -Identity 'OU=Lab-2025,DC=contoso,DC=com' -Recursive -Confirm:$false
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Remove-ADXOrganizationalUnit -Identity <string> [-Domain <string>] [-Recursive] [<CommonParameters>]#Parameters
- Identity string
- Gets or sets OU identity (DN, ou, or name).
- Domain string
- Gets or sets the optional domain DNS name.
- Recursive SwitchParameter
- Gets or sets whether descendants should be removed recursively.
Outputs
ADPlayground.DirectoryMutationResult