The specified argument 'ChildName' was not recognized Error joining DC as a child to Forest DC
I have the following scripts running.
Basically both scripts create files at runtime, and then the server restarts and run the newly created files, however there is error when the child DC joins the forest, even though it joins successfully.
Forest DC
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
New-Item $path -ItemType File
Set-Content -Path $path -Value @'
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-DomainName "electric-petrol.ie" `
-DomainNetbiosName "ELECTRIC-PETROL" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-Force:$true `
-SafeModeAdministratorPassword (ConvertTo-SecureString -String 'Passw0rd' -Force -AsPlainText)
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
Remove-Item -Path $path -Force
restart-computer
'@
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
New-Item $pathb -ItemType File
Set-Content -Path $pathb -Value @'
Restart-Service -Name NlaSvc -force
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices"
write-host "deleting used files.."
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-Item -Path $pathb -Force
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest" -Value "powershell.exe $path"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC1.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Child DC
$patha = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
New-Item $patha -ItemType File
Set-Content -Path $patha -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
add-computer -domainname $domname -Credential $cred
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain"
$pathb = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
New-Item $pathc -ItemType File
Set-Content -Path $pathc -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSDomain `
-credential $cred `
-CreateDnsDelegation:$true `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-NewDomainName "Abbeydorney" `
-ParentDomainName $domname `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-safemodeadministratorpassword $pass `
-Force:$true
Install-WindowsFeature -Name 'DHCP' –IncludeManagementTools
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest"
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain" -Value "powershell.exe $patha"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC2.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Error (Even though the child DC joins Forest successfully)
At C:UsersAdministratorDesktopJoinForest.ps1:9 char:1
+ Install-ADDSDomain -credential $cred -CreateDnsDelegation:$true -Data ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-ADDSDomain], TestFailedException
+ FullyQualifiedErrorId : Test.VerifyDcPromoCore.DCPromo.General.77,Microsoft.DirectoryServices.Deployment.PowerShell.Commands.InstallADDSDomainCommand
Message : Verification of prerequisites for Domain Controller promotion failed. The specified argument 'ChildName' was not recognized.
Context : Test.VerifyDcPromoCore.DCPromo.General.77
RebootRequired : False
Status : Error
Any thoughts as to what causes the error.
powershell windows-server-2016
add a comment |
I have the following scripts running.
Basically both scripts create files at runtime, and then the server restarts and run the newly created files, however there is error when the child DC joins the forest, even though it joins successfully.
Forest DC
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
New-Item $path -ItemType File
Set-Content -Path $path -Value @'
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-DomainName "electric-petrol.ie" `
-DomainNetbiosName "ELECTRIC-PETROL" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-Force:$true `
-SafeModeAdministratorPassword (ConvertTo-SecureString -String 'Passw0rd' -Force -AsPlainText)
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
Remove-Item -Path $path -Force
restart-computer
'@
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
New-Item $pathb -ItemType File
Set-Content -Path $pathb -Value @'
Restart-Service -Name NlaSvc -force
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices"
write-host "deleting used files.."
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-Item -Path $pathb -Force
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest" -Value "powershell.exe $path"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC1.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Child DC
$patha = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
New-Item $patha -ItemType File
Set-Content -Path $patha -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
add-computer -domainname $domname -Credential $cred
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain"
$pathb = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
New-Item $pathc -ItemType File
Set-Content -Path $pathc -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSDomain `
-credential $cred `
-CreateDnsDelegation:$true `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-NewDomainName "Abbeydorney" `
-ParentDomainName $domname `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-safemodeadministratorpassword $pass `
-Force:$true
Install-WindowsFeature -Name 'DHCP' –IncludeManagementTools
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest"
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain" -Value "powershell.exe $patha"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC2.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Error (Even though the child DC joins Forest successfully)
At C:UsersAdministratorDesktopJoinForest.ps1:9 char:1
+ Install-ADDSDomain -credential $cred -CreateDnsDelegation:$true -Data ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-ADDSDomain], TestFailedException
+ FullyQualifiedErrorId : Test.VerifyDcPromoCore.DCPromo.General.77,Microsoft.DirectoryServices.Deployment.PowerShell.Commands.InstallADDSDomainCommand
Message : Verification of prerequisites for Domain Controller promotion failed. The specified argument 'ChildName' was not recognized.
Context : Test.VerifyDcPromoCore.DCPromo.General.77
RebootRequired : False
Status : Error
Any thoughts as to what causes the error.
powershell windows-server-2016
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48
add a comment |
I have the following scripts running.
Basically both scripts create files at runtime, and then the server restarts and run the newly created files, however there is error when the child DC joins the forest, even though it joins successfully.
Forest DC
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
New-Item $path -ItemType File
Set-Content -Path $path -Value @'
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-DomainName "electric-petrol.ie" `
-DomainNetbiosName "ELECTRIC-PETROL" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-Force:$true `
-SafeModeAdministratorPassword (ConvertTo-SecureString -String 'Passw0rd' -Force -AsPlainText)
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
Remove-Item -Path $path -Force
restart-computer
'@
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
New-Item $pathb -ItemType File
Set-Content -Path $pathb -Value @'
Restart-Service -Name NlaSvc -force
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices"
write-host "deleting used files.."
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-Item -Path $pathb -Force
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest" -Value "powershell.exe $path"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC1.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Child DC
$patha = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
New-Item $patha -ItemType File
Set-Content -Path $patha -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
add-computer -domainname $domname -Credential $cred
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain"
$pathb = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
New-Item $pathc -ItemType File
Set-Content -Path $pathc -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSDomain `
-credential $cred `
-CreateDnsDelegation:$true `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-NewDomainName "Abbeydorney" `
-ParentDomainName $domname `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-safemodeadministratorpassword $pass `
-Force:$true
Install-WindowsFeature -Name 'DHCP' –IncludeManagementTools
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest"
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain" -Value "powershell.exe $patha"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC2.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Error (Even though the child DC joins Forest successfully)
At C:UsersAdministratorDesktopJoinForest.ps1:9 char:1
+ Install-ADDSDomain -credential $cred -CreateDnsDelegation:$true -Data ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-ADDSDomain], TestFailedException
+ FullyQualifiedErrorId : Test.VerifyDcPromoCore.DCPromo.General.77,Microsoft.DirectoryServices.Deployment.PowerShell.Commands.InstallADDSDomainCommand
Message : Verification of prerequisites for Domain Controller promotion failed. The specified argument 'ChildName' was not recognized.
Context : Test.VerifyDcPromoCore.DCPromo.General.77
RebootRequired : False
Status : Error
Any thoughts as to what causes the error.
powershell windows-server-2016
I have the following scripts running.
Basically both scripts create files at runtime, and then the server restarts and run the newly created files, however there is error when the child DC joins the forest, even though it joins successfully.
Forest DC
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
New-Item $path -ItemType File
Set-Content -Path $path -Value @'
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-DomainName "electric-petrol.ie" `
-DomainNetbiosName "ELECTRIC-PETROL" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-Force:$true `
-SafeModeAdministratorPassword (ConvertTo-SecureString -String 'Passw0rd' -Force -AsPlainText)
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$path = [Environment]::GetFolderPath("Desktop") + "AddForest.ps1"
Remove-Item -Path $path -Force
restart-computer
'@
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
New-Item $pathb -ItemType File
Set-Content -Path $pathb -Value @'
Restart-Service -Name NlaSvc -force
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "RestartNetworkServices"
write-host "deleting used files.."
$pathb = [Environment]::GetFolderPath("Desktop") + "RestartNetworkServices.ps1"
Remove-Item -Path $pathb -Force
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "AddForest" -Value "powershell.exe $path"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC1.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Child DC
$patha = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
New-Item $patha -ItemType File
Set-Content -Path $patha -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
add-computer -domainname $domname -Credential $cred
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain"
$pathb = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest" -Value "powershell.exe $pathb"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinDomain.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
New-Item $pathc -ItemType File
Set-Content -Path $pathc -Value @'
$srvr = "AbbeydorneyDC2"
$domname = "electric-petrol.ie"
$dom = ($domname).Remove(15,3)
$pass = convertto-securestring -string "Passw0rd" -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential -argumentlist ("$domAdministrator", $pass)
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
Install-ADDSDomain `
-credential $cred `
-CreateDnsDelegation:$true `
-DatabasePath "C:WindowsNTDS" `
-DomainMode "WinThreshold" `
-NewDomainName "Abbeydorney" `
-ParentDomainName $domname `
-InstallDns:$true `
-LogPath "C:WindowsNTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:WindowsSYSVOL" `
-safemodeadministratorpassword $pass `
-Force:$true
Install-WindowsFeature -Name 'DHCP' –IncludeManagementTools
Remove-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinForest"
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Remove-ItemProperty $RegPath -Name "AutoAdminLogon"
Remove-ItemProperty $RegPath -Name "DefaultUsername"
Remove-ItemProperty $RegPath -Name "DefaultPassword"
write-host "deleting used files.."
$pathc = [Environment]::GetFolderPath("Desktop") + "JoinForest.ps1"
Remove-Item -Path $pathc -Force
restart-computer
'@
$RegPath = "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"
Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1"
Set-ItemProperty $RegPath "DefaultUsername" -Value "Administrator" -type String
Set-ItemProperty $RegPath "DefaultPassword" -Value "Passw0rd" -type String
Set-ItemProperty "HKCU:SoftwareMicrosoftWindowsCurrentVersionRun" -Name "JoinDomain" -Value "powershell.exe $patha"
write-host "deleting used files.."
$pathd = [Environment]::GetFolderPath("Desktop") + "Abbeydorney_DC2.ps1"
Remove-Item -Path $pathd -Force
restart-computer
Error (Even though the child DC joins Forest successfully)
At C:UsersAdministratorDesktopJoinForest.ps1:9 char:1
+ Install-ADDSDomain -credential $cred -CreateDnsDelegation:$true -Data ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-ADDSDomain], TestFailedException
+ FullyQualifiedErrorId : Test.VerifyDcPromoCore.DCPromo.General.77,Microsoft.DirectoryServices.Deployment.PowerShell.Commands.InstallADDSDomainCommand
Message : Verification of prerequisites for Domain Controller promotion failed. The specified argument 'ChildName' was not recognized.
Context : Test.VerifyDcPromoCore.DCPromo.General.77
RebootRequired : False
Status : Error
Any thoughts as to what causes the error.
powershell windows-server-2016
powershell windows-server-2016
edited Feb 22 at 15:19
Huud Rych
asked Feb 22 at 14:49
Huud RychHuud Rych
187
187
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48
add a comment |
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1408514%2fthe-specified-argument-childname-was-not-recognized-error-joining-dc-as-a-chil%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1408514%2fthe-specified-argument-childname-was-not-recognized-error-joining-dc-as-a-chil%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may get a better response on serverfault.com the StackExchange site for managing servers.
– simon at rcl
Feb 22 at 15:55
Thank you, I will have a go there as well..
– Huud Rych
Feb 22 at 19:48