From 128782e91f8fd803bb4d3153e0fda08f5019683b Mon Sep 17 00:00:00 2001 From: dougbrw Date: Fri, 24 Jul 2015 14:02:55 +0100 Subject: [PATCH 1/8] Fixed invalid domain type When deploying a child domain on windows server 2012r2 I get the following error: VERBOSE: [2015-07-24T12:40:29] [ERROR] Unable to find type [Microsoft.DirectoryServices.Deployment.Types.DomainType] Modified "DomainType" parameter to a string --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index efe00bc5e..3f6048e77 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -160,7 +160,7 @@ function Set-TargetResource $params = @{ NewDomainName = $DomainName ParentDomainName = $ParentDomainName - DomainType = [Microsoft.DirectoryServices.Deployment.Types.DomainType]::ChildDomain + DomainType = "ChildDomain" SafeModeAdministratorPassword = $SafemodeAdministratorPassword.Password Credential = $DomainAdministratorCredential InstallDns = $true From 701a74124dac2cd70cc16764728a9fe96aa290ea Mon Sep 17 00:00:00 2001 From: dougbrw Date: Fri, 24 Jul 2015 14:09:40 +0100 Subject: [PATCH 2/8] Invalid parameter "DomainNetbiosName" A couple of problems here: 1. The cmdlet Install-ADDSDomain does not contain a parameter named "DomainNetbiosName", it should be "NewDomainNetbiosName" : https://technet.microsoft.com/en-us/library/hh974722(v=wps.630).aspx VERBOSE: [2015-07-24T12:44:04] [ERROR] A parameter cannot be found that matches parameter name 'DomainNetbiosName' 2. There is a broken if statement on Line 132 - always returns $true and adds DomainNetbiosName to the parameter hash table even if it is blank, as this is a non-mandatory parameter this logic is broken. --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index 3f6048e77..f1ca3db4f 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -129,7 +129,7 @@ function Set-TargetResource NoRebootOnCompletion = $true Force = $true } - if ($DomainNetbiosName -ne $null) + if ($DomainNetbiosName.length -gt 0) { $params.Add("DomainNetbiosName", $DomainNetbiosName) } From 4b07ffba205419c545ab6d76a800f8fb11fb6333 Mon Sep 17 00:00:00 2001 From: dougbrw Date: Fri, 24 Jul 2015 14:11:28 +0100 Subject: [PATCH 3/8] Fixed invalid parameter DomainNetbiosName for Install-ADDSForest --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index f1ca3db4f..ac277f3dd 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -131,7 +131,7 @@ function Set-TargetResource } if ($DomainNetbiosName.length -gt 0) { - $params.Add("DomainNetbiosName", $DomainNetbiosName) + $params.Add("NewDomainNetbiosName", $DomainNetbiosName) } if ($DnsDelegationCredential -ne $null) { @@ -167,9 +167,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) { From 2f6421f0ae0e49860226123e577336f201d1ff13 Mon Sep 17 00:00:00 2001 From: dougbrw Date: Mon, 27 Jul 2015 13:09:55 +0100 Subject: [PATCH 4/8] Update MSFT_xADDomain.psm1 --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index ac277f3dd..92bc74a5c 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -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)'." From e5e28baa956a71b5cc84d16a2f6b35a4ccf994fa Mon Sep 17 00:00:00 2001 From: dougbrw Date: Mon, 27 Jul 2015 13:19:36 +0100 Subject: [PATCH 5/8] Fixed Test-TargetResource function for child domain When using a child domain the Test-TargetResource function always returned false as it did not compare the fully qualified domain name --- DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 index 92bc74a5c..77f5efbcd 100644 --- a/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 +++ b/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1 @@ -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 { From ed5a73229a35bcc686658c18630bb9ae642ba8fb Mon Sep 17 00:00:00 2001 From: dougbrw Date: Fri, 7 Aug 2015 14:07:14 +0100 Subject: [PATCH 6/8] Added DNS flush in retry loop Due to the DNS client cache the retry loop is ineffective - if the domain did not exist this can be cached which prevents the retry loop from proceeding even once the domain is present. Flushing the DNS client cache between each retry avoids this. --- DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 index fedf56cf3..23c8c9ed7 100644 --- a/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 +++ b/DSCResources/MSFT_xWaitForADDomain/MSFT_xWaitForADDomain.psm1 @@ -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 } } From 5a184c1a18615adb565f3244697f877bcd55b8d4 Mon Sep 17 00:00:00 2001 From: Karol Kaczmarek Date: Fri, 11 Sep 2015 12:41:35 -0700 Subject: [PATCH 7/8] Update readme and module manifest for version 2.6.0.0 --- README.md | 5 +++++ appveyor.yml | 4 ++-- xActiveDirectory.psd1 | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 90b61147c..a09a9588b 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,12 @@ Domain Naming Master FSMO of the forest. ## Versions +### 2.6.0.0 + +* Removed xDscResourceDesigner tests (moved to common tests) + ### 2.5.0.0 + * Updated xADDomainTrust and xADRecycleBin tests ### 2.4.0.0 diff --git a/appveyor.yml b/appveyor.yml index 319cc017e..9c51b50dd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ #---------------------------------# # environment configuration # #---------------------------------# -version: 2.5.{build}.0 +version: 2.6.{build}.0 install: - cinst -y pester - git clone https://github.com/PowerShell/DscResource.Tests @@ -45,7 +45,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.6.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) diff --git a/xActiveDirectory.psd1 b/xActiveDirectory.psd1 index af3234db0..82f4f06a9 100644 --- a/xActiveDirectory.psd1 +++ b/xActiveDirectory.psd1 @@ -1,6 +1,6 @@ @{ # Version number of this module. -ModuleVersion = '2.5.0.0' +ModuleVersion = '2.6.0.0' # ID used to uniquely identify this module GUID = '9FECD4F6-8F02-4707-99B3-539E940E9FF5' From 4624da46a62e42bf2f12e52444c7643006f6c3d6 Mon Sep 17 00:00:00 2001 From: Karol Kaczmarek Date: Thu, 22 Oct 2015 11:52:25 -0700 Subject: [PATCH 8/8] Release of version 2.7.0.0 --- README.md | 5 +++++ appveyor.yml | 4 ++-- xActiveDirectory.psd1 | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a09a9588b..8a5089346 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,11 @@ Domain Naming Master FSMO of the forest. ## 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) diff --git a/appveyor.yml b/appveyor.yml index 9c51b50dd..957ab691f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ #---------------------------------# # environment configuration # #---------------------------------# -version: 2.6.{build}.0 +version: 2.7.{build}.0 install: - cinst -y pester - git clone https://github.com/PowerShell/DscResource.Tests @@ -45,7 +45,7 @@ before_deploy: # Creating project artifact $stagingDirectory = (Resolve-Path ..).Path $manifest = Join-Path $pwd "xActiveDirectory.psd1" - (Get-Content $manifest -Raw).Replace("2.6.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) diff --git a/xActiveDirectory.psd1 b/xActiveDirectory.psd1 index 82f4f06a9..caf000d10 100644 --- a/xActiveDirectory.psd1 +++ b/xActiveDirectory.psd1 @@ -1,6 +1,6 @@ @{ # Version number of this module. -ModuleVersion = '2.6.0.0' +ModuleVersion = '2.7.0.0' # ID used to uniquely identify this module GUID = '9FECD4F6-8F02-4707-99B3-539E940E9FF5'