Configuration driven Active Directory management.
This Component allows defining Organizational Units in configuration.
One of the most straightforward Components, there is one thing to note:
It will refuse to delete Organizational Units that should be deleted, so long as they have any content. Instead it will write a warning telling you to clean up.
Default definition for the Domain Controllers OU:
[
{
"Name": "Domain Controllers",
"Description": "Default container for domain controllers",
"Path": "%DomainDN%"
}
]
Convert all Organizational Units into Json configuration:
Get-ADOrganizationalUnit -Filter * -Properties Description |
Select-PSFObject @(
'Name'
'Description to string'
@{
Name = 'Path'
Expression = {
$_.DistinguishedName.Split(",",2)[1] -replace 'DC=.+$','%DomainDN%'
}
}
) | ConvertTo-Json
This parameter uses name resolution.
Name of the OU to register.
This parameter uses name resolution.
Description for the OU to register.
This parameter uses name resolution.
The path to where the OU should be.
This parameter uses name resolution.
Previous names the OU had. During invocation, if it is not found but an OU in the same path with a listed old name IS, it will be renamed.
Optional: Yes | Default: $true |
Whether the OU should be present.