Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
iainbrighton committed Oct 26, 2015
2 parents 450509b + 9cc8834 commit d9750d4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
20 changes: 13 additions & 7 deletions DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Get-TargetResource
{
$dc = Get-ADDomainController -Identity $env:COMPUTERNAME -Credential $DomainAdministratorCredential
Write-Verbose -Message "Found domain controller '$($dc.Name)' in domain '$($dc.Domain)'."
Write-Verbose -Message "Found parent domain '$($dc.ParentDomain)', expected '$($ParentDomainName)'."
Write-Verbose -Message "Found parent domain '$($domain.ParentDomain)', expected '$($ParentDomainName)'."
if (($dc.Domain -eq $DomainName) -and ((!($dc.ParentDomain) -and !($ParentDomainName)) -or ($dc.ParentDomain -eq $ParentDomainName)))
{
Write-Verbose -Message "Current node '$($dc.Name)' is already a domain controller for domain '$($dc.Domain)'."
Expand Down Expand Up @@ -129,9 +129,9 @@ function Set-TargetResource
NoRebootOnCompletion = $true
Force = $true
}
if ($DomainNetbiosName -ne $null)
if ($DomainNetbiosName.length -gt 0)
{
$params.Add("DomainNetbiosName", $DomainNetbiosName)
$params.Add("NewDomainNetbiosName", $DomainNetbiosName)
}
if ($DnsDelegationCredential -ne $null)
{
Expand Down Expand Up @@ -160,16 +160,16 @@ function Set-TargetResource
$params = @{
NewDomainName = $DomainName
ParentDomainName = $ParentDomainName
DomainType = [Microsoft.DirectoryServices.Deployment.Types.DomainType]::ChildDomain
DomainType = "ChildDomain"
SafeModeAdministratorPassword = $SafemodeAdministratorPassword.Password
Credential = $DomainAdministratorCredential
InstallDns = $true
NoRebootOnCompletion = $true
Force = $true
}
if ($DomainNetbiosName -ne $null)
if ($DomainNetbiosName.length -gt 0)
{
$params.Add("DomainNetbiosName", $DomainNetbiosName)
$params.Add("NewDomainNetbiosName", $DomainNetbiosName)
}
if ($DnsDelegationCredential -ne $null)
{
Expand Down Expand Up @@ -230,7 +230,13 @@ function Test-TargetResource
{
$parameters = $PSBoundParameters.Remove("Debug");
$existingResource = Get-TargetResource @PSBoundParameters
$existingResource.DomainName -eq $DomainName

$fullDomainName = $DomainName
if ($ParentDomainName)
{
$fullDomainName = $DomainName + "." + $ParentDomainName
}
$existingResource.DomainName -eq $fullDomainName
}
catch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function Set-TargetResource
{
Write-Verbose -Message "Domain $DomainName not found. Will retry again after $RetryIntervalSec sec"
Start-Sleep -Seconds $RetryIntervalSec
Clear-DnsClientCache
}
}

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,17 @@ __Note: This resource does not currently manage group membership.__

## Versions

### 2.7.0.0

* Added DNS flush in retry loop
* Bug fixes in xADDomain resource

### 2.6.0.0

* Removed xDscResourceDesigner tests (moved to common tests)

### 2.5.0.0

* Updated xADDomainTrust and xADRecycleBin tests

### 2.4.0.0
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#---------------------------------#
# environment configuration #
#---------------------------------#
version: 2.5.{build}.0
version: 2.7.{build}.0
install:
- cinst -y pester
- git clone https://github.com/PowerShell/DscResource.Tests
Expand Down Expand Up @@ -47,7 +47,7 @@ before_deploy:
# Creating project artifact
$stagingDirectory = (Resolve-Path ..).Path
$manifest = Join-Path $pwd "xActiveDirectory.psd1"
(Get-Content $manifest -Raw).Replace("2.5.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
(Get-Content $manifest -Raw).Replace("2.7.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
$zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip"
Add-Type -assemblyname System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath)
Expand Down
2 changes: 1 addition & 1 deletion xActiveDirectory.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
# Version number of this module.
ModuleVersion = '2.5.0.0'
ModuleVersion = '2.7.0.0'

# ID used to uniquely identify this module
GUID = '9FECD4F6-8F02-4707-99B3-539E940E9FF5'
Expand Down

0 comments on commit d9750d4

Please sign in to comment.