-
Notifications
You must be signed in to change notification settings - Fork 141
/
2-ADDomainTrust_ExternalInboundTrustWithOptInToRecreate_Config.ps1
58 lines (52 loc) · 1.54 KB
/
2-ADDomainTrust_ExternalInboundTrustWithOptInToRecreate_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
57
58
<#PSScriptInfo
.VERSION 1.0
.GUID 2caf2b93-d87e-426d-8c44-9f1d0452be10
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/ActiveDirectoryDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/ActiveDirectoryDsc
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>
#Requires -module ActiveDirectoryDsc
<#
.DESCRIPTION
This configuration will create a new one way inbound trust between two
domains, and allows the trust to recreated if it should have the wrong
trust type.
#>
Configuration ADDomainTrust_ExternalInboundTrustWithOptInToRecreate_Config
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$SourceDomain,
[Parameter(Mandatory = $true)]
[System.String]
$TargetDomain,
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$TargetDomainAdminCred
)
Import-DscResource -module ActiveDirectoryDsc
node localhost
{
ADDomainTrust 'Trust'
{
Ensure = 'Present'
SourceDomainName = $SourceDomain
TargetDomainName = $TargetDomain
TargetCredential = $TargetDomainAdminCred
TrustDirection = 'Inbound'
TrustType = 'External'
AllowTrustRecreation = $true
}
}
}