TestimoX

API Reference

Command

Remove-ADXOrganizationalUnit

Namespace ADPlayground.PowerShell
Outputs
ADPlayground.DirectoryMutationResult

Removes an Active Directory organizational unit.

Examples

Authored help example

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 requiredposition: 0pipeline: falsealiases: DistinguishedName, DN, Name, OU
Gets or sets OU identity (DN, ou, or name).
Domain string optionalposition: namedpipeline: falsealiases: DomainName
Gets or sets the optional domain DNS name.
Recursive SwitchParameter optionalposition: namedpipeline: false
Gets or sets whether descendants should be removed recursively.

Outputs

ADPlayground.DirectoryMutationResult