diff options
author | heqnx <root@heqnx.com> | 2025-07-14 16:16:45 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-07-14 16:16:45 +0300 |
commit | 32a92a4fd19baa6438c0443deb247e93d02b1948 (patch) | |
tree | 8e310eeaac4da16f58badbb8e906f6566c3c0803 /ansible/scripts/setup-tree-domain.ps1 | |
parent | b1ca188b8a16a49b79cd18ae39261fe9c666edf1 (diff) | |
download | ansible-active-directory-range-32a92a4fd19baa6438c0443deb247e93d02b1948.tar.gz ansible-active-directory-range-32a92a4fd19baa6438c0443deb247e93d02b1948.zip |
added defender disabling gpo, changed print messages in scripts, logging set domain network
Diffstat (limited to 'ansible/scripts/setup-tree-domain.ps1')
-rw-r--r-- | ansible/scripts/setup-tree-domain.ps1 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ansible/scripts/setup-tree-domain.ps1 b/ansible/scripts/setup-tree-domain.ps1 index 0f661a1..d6908c1 100644 --- a/ansible/scripts/setup-tree-domain.ps1 +++ b/ansible/scripts/setup-tree-domain.ps1 @@ -14,20 +14,20 @@ Start-Transcript -Path $logFile -Append $p = ConvertTo-SecureString $Password -AsPlainText -Force $c = New-Object System.Management.Automation.PSCredential("$ParentForestRootDomain\$Username", $p) -Write-Host "[INFO] Setting Administrator password" +Write-Host "[inf] Setting Administrator password" $computerName = $env:COMPUTERNAME $adminPassword = $Password $adminUser = [ADSI] "WinNT://$computerName/Administrator,User" $adminUser.SetPassword($adminPassword) -Write-Host "[INFO] Installing AD-Domain-Services feature" +Write-Host "[inf] Installing AD-Domain-Services feature" Install-WindowsFeature AD-Domain-Services -IncludeAllSubFeature -IncludeManagementTools -Write-Host "[INFO] Importing ADDSDeployment module" +Write-Host "[inf] Importing ADDSDeployment module" Import-Module ADDSDeployment try { - Write-Host "[INFO] Installing New Tree Domain in Existing Forest" + Write-Host "[inf] Installing New Tree Domain in Existing Forest" Install-ADDSDomain ` -InstallDns ` -ParentDomainName $ParentForestRootDomain ` @@ -41,9 +41,9 @@ try { -Credential $c ` -SafeModeAdministratorPassword (ConvertTo-SecureString -AsPlainText -Force "$SafeModePassword") - Write-Host "[INFO] Successfully added new tree domain: $NewTreeDomainName" + Write-Host "[inf] Successfully added new tree domain: $NewTreeDomainName" } catch { - Write-Host "[ERR] Failed to add new tree domain: $NewTreeDomainName" + Write-Host "[err] Failed to add new tree domain: $NewTreeDomainName" Write-Host $_.Exception.Message } |