Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xActiveDirectory: Add Missing Resource Examples #397

Merged
merged 4 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
}