-
Notifications
You must be signed in to change notification settings - Fork 141
ADOrganizationalUnit
dscbot edited this page Aug 24, 2023
·
6 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | The name of the Organizational Unit (OU). | |
Path | Key | String | Specifies the X.500 path of the Organizational Unit (OU) or container where the new object is created. | |
Ensure | Write | String | Specifies whether the Organizational Unit (OU) should be present or absent. Default value is 'Present'. |
Present , Absent
|
Credential | Write | PSCredential | The credential to be used to perform the operation on Active Directory. | |
DomainController | Write | String | Specifies the Active Directory Domain Services instance to use to perform the task. | |
ProtectedFromAccidentalDeletion | Write | Boolean | Specifies if the Organizational Unit (OU) container should be protected from deletion. Default value is $true. | |
Description | Write | String | Specifies the description of the Organizational Unit (OU). Default value is empty (''). | |
RestoreFromRecycleBin | Write | Boolean | Try to restore the Organizational Unit (OU) from the recycle bin before creating a new one. | |
DistinguishedName | Read | String | Returns the X.500 distinguished name of the Organizational Unit. |
The ADOrganizational Unit DSC resource will manage Organizational Units (OUs) within Active Directory. An OU is a subdivision within an Active Directory into which you can place users, groups, computers, and other organizational units.
- Target machine must be running Windows Server 2008 R2 or later.
- The parameter
RestoreFromRecycleBin
requires that the feature Recycle Bin has been enabled prior to an object being deleted. If the Recycle Bin feature is disabled then the propertymsDS-LastKnownRDN
is not added the deleted object.
This configuration will add an Active Directory organizational unit to the domain.
Configuration ADOrganizationalUnit_CreateADOU_Config
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Name,
[Parameter(Mandatory = $true)]
[System.String]
$Path,
[Parameter()]
[System.Boolean]
$ProtectedFromAccidentalDeletion = $true,
[Parameter()]
[ValidateNotNull()]
[System.String]
$Description = ''
)
Import-DscResource -Module ActiveDirectoryDsc
Node localhost
{
ADOrganizationalUnit 'ExampleOU'
{
Name = $Name
Path = $Path
ProtectedFromAccidentalDeletion = $ProtectedFromAccidentalDeletion
Description = $Description
Ensure = 'Present'
}
}
}
- ADComputer
- ADDomain
- ADDomainController
- ADDomainControllerProperties
- ADDomainDefaultPasswordPolicy
- ADDomainFunctionalLevel
- ADDomainTrust
- ADFineGrainedPasswordPolicy
- ADForestFunctionalLevel
- ADForestProperties
- ADGroup
- ADKDSKey
- ADManagedServiceAccount
- ADObjectEnabledState
- ADObjectPermissionEntry
- ADOptionalFeature
- ADOrganizationalUnit
- ADReadOnlyDomainControllerAccount
- ADReplicationSite
- ADReplicationSiteLink
- ADReplicationSubnet
- ADServicePrincipalName
- ADUser
- Home
- WaitForADDomain