TestimoX

API Reference

Command

Get-ADXOrganizationalUnitContents

Namespace ADPlayground.PowerShell
Outputs
ADPlayground.DirectoryOrganizationalUnitContentItem

Retrieves contents of an Active Directory organizational unit with optional recursion and custom attributes.

Examples

Authored help example

Example 1: List every object under an OU recursively


Get-ADXOrganizationalUnitContents -Identity 'OU=Workstations,OU=Managed,DC=contoso,DC=com' -Recursive -MaxResults 5000
        

Example 2: Return only enabled user accounts and selected attributes from an OU


Get-ADXOrganizationalUnitContents -Identity 'OU=Users,OU=Managed,DC=contoso,DC=com' -LDAPFilter '(&(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))' -Property department, title, employeeID
        

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

Get-ADXOrganizationalUnitContents -Identity <string> [-Domain <string>] [-LDAPFilter <string>] [-MaxResults <int>] [-Property <string[]>] [-Recursive] [<CommonParameters>]
#

Parameters

Identity string requiredposition: 0pipeline: false
Gets or sets OU identity (DN, ou, or name).
Domain string optionalposition: namedpipeline: false
Gets or sets the optional domain DNS name.
LDAPFilter string optionalposition: namedpipeline: false
Gets or sets optional custom LDAP filter.
MaxResults int optionalposition: namedpipeline: false
Gets or sets maximum number of returned objects.
Property string[] optionalposition: namedpipeline: false
Gets or sets optional additional LDAP attributes.
Recursive SwitchParameter optionalposition: namedpipeline: false
Gets or sets whether to query recursively.

Outputs

ADPlayground.DirectoryOrganizationalUnitContentItem