Skip to content

Commit

Permalink
xActiveDirectory: Add Missing Resource Examples (#397)
Browse files Browse the repository at this point in the history
- Changes to xActiveDirectory
  - Added missing examples for xADReplicationSubnet, xADServicePrincipalName and xWaitForADDomain (issue #395).
  • Loading branch information
X-Guardian authored and johlju committed Jun 26, 2019
1 parent 7fb5aa7 commit 46634ed
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
- Use fully qualified type names for parameters and variables
([issue #374](https://github.com/PowerShell/xActiveDirectory/issues/374)).
- Removed unused legacy test files from the root of the repository.
- Updated Example List README with missing resources
- Updated Example List README with missing resources.
- Added missing examples for xADReplicationSubnet, xADServicePrincipalName and xWaitForADDomain. ([issue #395](https://github.com/PowerShell/xActiveDirectory/issues/395)).
- Changes to xADComputer
- Refactored the resource and the unit tests.
- BREAKING CHANGE: The `Enabled` property is **DEPRECATED** and is no
Expand Down
4 changes: 4 additions & 0 deletions Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ These are the links to the examples for each individual resource:
- [xADGroup](Resources/xADGroup)
- [xADKDSKey](Resources/xADKDSKey)
- [xADManagedServiceAccount](Resources/xADManagedServiceAccount)
- [xADObjectEnabledState](Resources/xADObjectEnabledState)
- [xADObjectPermissionEntry](Resources/xADObjectPermissionEntry)
- [xADOrganizationalUnit](Resources/xADOrganizationalUnit)
- [xADRecycleBin](Resources/xADRecycleBin)
- [xADReplicationSite](Resources/xADReplicationSite)
- [xADReplicationSiteLink](Resources/xADReplicationSiteLink)
- [xADReplicationSubnet](Resources/xADReplicationSubnet)
- [xADServicePrincipalName](Resources/xADServicePrincipalName)
- [xADUser](Resources/xADUser)
- [xWaitForADDomain](Resources/xWaitForADDomain)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<#PSScriptInfo
.VERSION 1.0
.GUID 3d2af0ab-3470-4da7-a38b-1c05ef384e05
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xActiveDirectory/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/xActiveDirectory
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>

#Requires -module xActiveDirectory

<#
.DESCRIPTION
This configuration will create an AD Replication Subnet.
#>

Configuration CreateReplicationSubnet_Config
{
Import-DscResource -Module xActiveDirectory

Node localhost
{
xADReplicationSubnet 'LondonSubnet'
{
Name = '10.0.0.0/24'
Site = 'London'
Location = 'Datacenter 3'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<#PSScriptInfo
.VERSION 1.0
.GUID 0c29d71c-5787-49e6-97e9-c74583028f63
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xActiveDirectory/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/xActiveDirectory
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>

#Requires -module xActiveDirectory

<#
.DESCRIPTION
This configuration will add a Service Principal Name to a user account.
#>

Configuration AddUserServicePrincipalName_Config
{
Import-DscResource -Module xActiveDirectory

Node localhost
{
xADServicePrincipalName 'SQL01Svc'
{
ServicePrincipalName = 'MSSQLSvc/sql01.contoso.com:1433'
Account = 'SQL01Svc'
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<#PSScriptInfo
.VERSION 1.0
.GUID 634194bb-189a-4b26-bd80-7c01270026ea
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xActiveDirectory/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/xActiveDirectory
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>

#Requires -module xActiveDirectory

<#
.DESCRIPTION
This configuration will add a Service Principal Name to a computer account.
#>

Configuration AddComputerServicePrincipalName_Config
{
Import-DscResource -Module xActiveDirectory

Node localhost
{
xADServicePrincipalName 'web.contoso.com'
{
ServicePrincipalName = 'HTTP/web.contoso.com'
Account = 'IIS01$'
}
}
}
39 changes: 39 additions & 0 deletions Examples/Resources/xWaitForADDomain/1-WaitForADDomain_Config.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<#PSScriptInfo
.VERSION 1.0
.GUID 5f105122-a318-46f4-a7e9-7dc745c57878
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xActiveDirectory/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/xActiveDirectory
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>

#Requires -module xActiveDirectory

<#
.DESCRIPTION
This configuration will wait for an AD Domain to respond before returning.
#>

Configuration WaitForADDomain_Config
{
Import-DscResource -Module xActiveDirectory

Node localhost
{
xWaitForADDomain 'contoso.com'
{
DomainName = 'contoso.com'
RetryIntervalSec = 60
RetryCount = 10
RebootRetryCount = 1
}
}
}

0 comments on commit 46634ed

Please sign in to comment.