Active Directory: Organizational Units
Summary
This module contains actions related to Active Directory Organizational Units.
Actions
active_directory.organizational_units.
by_distinguishedname
Get an organizational unit by its 'distinguishedName' attribute.
Minimum Plugin Version: 5.2.0
Input
-
domain_controller: a DomainController dictionary
-
distinguishedName: The organizational unit's
distinguishedName
Output
A single Organizational Unit.
Example
1 2 3 4 5 |
|
active_directory.organizational_units.
create
Create a new organizational unit.
Minimum Plugin Version: 5.2.0
Input
-
domain_controller: a DomainController
-
name: the new organizational unit name
-
distinguishedName: the new organizational unit distinguishedName
-
extra_params: a dictionary containing any extra LDAP attributes & values for the organizational unit
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 |
|
active_directory.organizational_units.
delete
Delete an organizational unit.
Minimum Plugin Version: 5.2.0
Input
-
domain_controller: a DomainController
-
distinguishedName: the distinguishedName of the organizational unit to delete
Output
Nothing is outputted by this action.
Example
1 2 3 4 |
|
active_directory.organizational_units.
display
Display organizational units in a table.
The table will have the following columns:
- Name
- Distinguished Name
Minimum Plugin Version: 6.0.0
Input
-
text: the title of the table
-
organizational_units: any number of Organizational Units
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 7 8 9 |
|
active_directory.organizational_units.
display_tabbed
Display organizational units in a table with multiple tabs.
The table will have the following columns:
- Name
- Distinguished Name
Minimum Plugin Version: 6.0.0
Input
-
text: the title of the table
-
tabs: a dictionary where each key is a tab name & each value is any number of Organizational Units
Output
Nothing is outputted by this action.
Example
Auditing user accounts from 2 OUs & presenting them in a tabbed table:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
active_directory.organizational_units.
exists
Search for organizational units using LDAP attributes & values to identify if any were found.
Minimum Plugin Version: 5.2.0
Input
-
domain_controller: a DomainController dictionary
-
search_params: a dictionary containing OrganizationalUnit keys & values to use in the search
Output
A boolean is outputted by this action
-
true
if one or more organizational units are found -
false
if no organizational units are found
Example
Searching using a unique attribute:
1 2 3 4 5 |
|
Wildcard Searching
It is possible to use *
as a wildcard at the end of search values, but this can make the search slow.
active_directory.organizational_units.
get_all
Get all organizational units.
This operation can be slow on large domains
Minimum Plugin Version: 6.1.0
Input
-
domain_controller: a DomainController dictionary
-
search_base: optional start point for the search (see here for more information)
-
one_level: set to
true
to only search one level (see here for more information)
Output
A list of Organizational Units.
Example
1 2 3 4 |
|
active_directory.organizational_units.
input_table
Display organizational units in a table, & allow the task operator to make a selection.
The table will have the following columns:
- Name
- Distinguished Name
Deprecation Warning
This action will soon be deprecated in favour of select.
Minimum Plugin Version: 5.2.0
Input
-
text: the title of the table
-
organizational_units: any number of Organizational Units
-
minimum: the minimum number of acceptable selections
-
maximum: the maximum number of acceptable selections
Output
A list of Organizational Units.
Tip
- If neither a minimum or maximum is provided, the task operator will be able to submit 0 selections.
- If minimum or maximum are provided, the operation will repeat until the task operator makes a valid number of selections.
Example
-
Getting all organizational units whose common names start with UAT
-
Saving the results as a new variable called
uat_ous
-
Using this action to show the
uat_ous
in a table, requiring the task operator selects at least 1 -
The selection is saved as a new variable called
selected_ous
1 2 3 4 5 6 7 8 9 10 11 12 |
|
active_directory.organizational_units.
move
Move an organizational unit to a different OU or CN.
Minimum Plugin Version: 5.2.0
Input
-
domain_controller: a DomainController
-
distinguishedName: the distinguishedName of the organizational unit to move
-
parent_distinguishedName: the distinguishedName of the new organizational unit parent
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 |
|
active_directory.organizational_units.
output_tabbed_table
Display an organizational units table with multiple tabs.
This action can be used to display organizational unit lists from multiple Active Directories.
The table will have the following columns:
- Name
- Distinguished Name
Deprecation Warning
This action will soon be deprecated in favour of display_tabbed.
Minimum Plugin Version: 5.2.0
Input
-
text: the title of the table
-
tabs: a dictionary where each key is a tab name & each value is a list of OrganizationalUnit dictionaries
Output
Nothing is outputted by this action.
Example
Auditing user accounts from 2 domains & presenting them in a tabbed table:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
active_directory.organizational_units.
output_table
Display organizational units in a table.
The table will have the following columns:
- Name
- Distinguished Name
Deprecation Warning
This action will soon be deprecated in favour of display.
Minimum Plugin Version: 5.2.0
Input
-
text: the title of the table
-
organizational_units: a single or list of Organizational Units
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 7 8 9 |
|
active_directory.organizational_units.
search
Search for organizational units using LDAP attributes & values.
Minimum Plugin Version: 6.1.0
Input
-
domain_controller: a DomainController
-
search_params: a dictionary containing Organizational Unit keys & values to use in the search
-
search_base: optional start point for the search (see here for more information)
-
one_level: set to
true
to only search one level (see here for more information)
Output
A SearchResult containing:
-
total: the number of Organizational Units found
-
all: a list of Organizational Units found
-
first: the first Organizational Unit found
-
last: the last Organizational Unit found
Search Result Format
The search result format was updated in version 6.0.0 of this plugin.
It is not compatible with playbooks written against previous versions.
See here for more information.
Example
Searching for all organizational units in the Users CN whose cn
starts with admin*:
1 2 3 4 5 6 7 |
|
Tip
You can use *
as a wildcard at the end of search values.
active_directory.organizational_units.
select
Display organizational units in a table & prompt the task operator to make a selection.
The table will have the following columns:
- Name
- Distinguished Name
Minimum Plugin Version: 6.0.0
Input
-
text: the title of the table
-
organizational_units: any number of Organizational Units
-
minimum: the minimum number of acceptable selections
-
maximum: the maximum number of acceptable selections
Output
A Selection containing:
-
total: the number of selected Organizational Units
-
all: a list of selected Organizational Units
-
first: the first selected Organizational Unit
Example
1 2 3 4 5 6 7 8 9 10 |
|
active_directory.organizational_units.
select_one
Display Organizational Units in a table & prompt the task operator to select one.
The table will have the following columns:
- Name
- Distinguished Name
Minimum Plugin Version: 6.0.0
Input
-
text: the title of the table
-
organizational_units: any number of Organizational Units
-
minimum: the minimum number of acceptable selections
-
maximum: the maximum number of acceptable selections
Output
A single Organizational Unit.
Example
1 2 3 4 5 6 7 8 9 10 |
|