diff --git a/CHANGELOG.md b/CHANGELOG.md index baab612c9..496559301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Examples/README.md b/Examples/README.md index 9e4d3ca45..acf0b6f8f 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -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) diff --git a/Examples/Resources/xADReplicationSubnet/1-CreateReplicationSubnet_Config.ps1 b/Examples/Resources/xADReplicationSubnet/1-CreateReplicationSubnet_Config.ps1 new file mode 100644 index 000000000..068fc5775 --- /dev/null +++ b/Examples/Resources/xADReplicationSubnet/1-CreateReplicationSubnet_Config.ps1 @@ -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' + } + } +} diff --git a/Examples/Resources/xADServicePrincipalName/1-AddUserServicePrincipalName_Config.ps1 b/Examples/Resources/xADServicePrincipalName/1-AddUserServicePrincipalName_Config.ps1 new file mode 100644 index 000000000..8df95de5e --- /dev/null +++ b/Examples/Resources/xADServicePrincipalName/1-AddUserServicePrincipalName_Config.ps1 @@ -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' + } + } +} diff --git a/Examples/Resources/xADServicePrincipalName/2-AddComputerServicePrincipalName_Config.ps1 b/Examples/Resources/xADServicePrincipalName/2-AddComputerServicePrincipalName_Config.ps1 new file mode 100644 index 000000000..d2933ad5c --- /dev/null +++ b/Examples/Resources/xADServicePrincipalName/2-AddComputerServicePrincipalName_Config.ps1 @@ -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$' + } + } +} diff --git a/Examples/Resources/xWaitForADDomain/1-WaitForADDomain_Config.ps1 b/Examples/Resources/xWaitForADDomain/1-WaitForADDomain_Config.ps1 new file mode 100644 index 000000000..5bb23d831 --- /dev/null +++ b/Examples/Resources/xWaitForADDomain/1-WaitForADDomain_Config.ps1 @@ -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 + } + } +}