diff --git a/powershell/Scripts/ModPlatformAD/Install-ModPlatformADDomainController.ps1 b/powershell/Scripts/ModPlatformAD/Install-ModPlatformADDomainController.ps1 index 8d3e77062..442476377 100644 --- a/powershell/Scripts/ModPlatformAD/Install-ModPlatformADDomainController.ps1 +++ b/powershell/Scripts/ModPlatformAD/Install-ModPlatformADDomainController.ps1 @@ -42,9 +42,22 @@ if ($DFSReplicationStatus -eq $null) { $ADAdminCredential = Get-ModPlatformADAdminCredential -ModPlatformADConfig $ADConfig -ModPlatformADSecret $ADSecret $ADSafeModeAdministratorPassword = Get-ModPlatformADSafeModeAdministratorPassword -ModPlatformADConfig $ADConfig -ModPlatformADSecret $ADSecret Install-WindowsFeature -Name AD-Domain-Services -IncludeAllSubFeature -IncludeManagementTools - Install-ADDSDomainController -DomainName $ADConfig.DomainNameFQDN -InstallDns:$true -Credential $ADAdminCredential -SafeModeAdministratorPassword $ADSafeModeAdministratorPassword -NoRebootOnCompletion -Force + Install-ADDSDomainController ` + -DomainName $ADConfig.DomainNameFQDN ` + -InstallDns:$true ` + -Credential $ADAdminCredential ` + -SafeModeAdministratorPassword $ADSafeModeAdministratorPassword ` + -NoRebootOnCompletion ` + -NoGlobalCatalog:$false ` + -CreateDnsDelegation:$false ` + -CriticalReplicationOnly:$false ` + -DatabasePath "C:\Windows\NTDS" ` + -LogPath "C:\Windows\NTDS" ` + -SysvolPath "C:\Windows\SYSVOL" ` + -SiteName "Default-First-Site-Name" ` + -Force Exit 3010 # triggers reboot if running from SSM Doc } else { - $Services='DNS','DFS Replication','Intersite Messaging','Kerberos Key Distribution Center','NetLogon',’Active Directory Domain Services’ + $Services='DNS','DFS Replication','Intersite Messaging','Kerberos Key Distribution Center','NetLogon','Active Directory Domain Services' ForEach ($Service in $Services) {Get-Service $Service | Select-Object Name, Status} } diff --git a/powershell/Scripts/ModPlatformAD/Uninstall-ModPlatformADDomainController.ps1 b/powershell/Scripts/ModPlatformAD/Uninstall-ModPlatformADDomainController.ps1 index c14b44826..b28981f1e 100644 --- a/powershell/Scripts/ModPlatformAD/Uninstall-ModPlatformADDomainController.ps1 +++ b/powershell/Scripts/ModPlatformAD/Uninstall-ModPlatformADDomainController.ps1 @@ -36,6 +36,6 @@ $DFSReplicationStatus = Get-Service "DFS Replication" -ErrorAction SilentlyConti if ($DFSReplicationStatus -ne $null) { $ADAdminCredential = Get-ModPlatformADAdminCredential -ModPlatformADConfig $ADConfig -ModPlatformADSecret $ADSecret $ADSafeModeAdministratorPassword = Get-ModPlatformADSafeModeAdministratorPassword -ModPlatformADConfig $ADConfig -ModPlatformADSecret $ADSecret - Uninstall-ADDSDomainController -Credential $ADAdminCredential -NoRebootOnCompletion -Force + Uninstall-ADDSDomainController -Credential $ADAdminCredential -NoRebootOnCompletion -DemoteOperationMasterRole -ForceRemoval -Force Exit 3010 # triggers reboot if running from SSM Doc }