forked from dsccommunity/ActiveDirectoryDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-ADOrganizationalUnit_CreateADOU_Config.ps1
56 lines (49 loc) · 1.46 KB
/
1-ADOrganizationalUnit_CreateADOU_Config.ps1
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<#PSScriptInfo
.VERSION 1.0.1
.GUID e7ed876c-7a6b-46d7-bb89-8288680c1691
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/ActiveDirectoryDsc/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/ActiveDirectoryDsc
.ICONURI https://dsccommunity.org/images/DSC_Logo_300p.png
.RELEASENOTES
Updated author, copyright notice, and URLs.
#>
#Requires -Module ActiveDirectoryDsc
<#
.DESCRIPTION
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'
}
}
}