UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit 2d4fbcb5 authored by John Rollinson's avatar John Rollinson
Browse files

Add AD initialization

parent 0f53eee7
Branches
No related merge requests found
......@@ -55,7 +55,7 @@ resources:
SUBNET: { get_param: subnet }
gateway_ip:
str_replace:
template: SUBNET.254
template: SUBNET.1
params:
SUBNET: { get_param: subnet }
dns_nameservers: [10.50.255.254]
......@@ -87,19 +87,19 @@ resources:
router_id: { get_resource: external_router }
subnet_id: { get_resource: subnet_0 }
server_1_subnet_0_port:
dc01_subnet_0_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: network_0 }
fixed_ips:
- ip_address:
str_replace:
template: SUBNET.1
template: SUBNET.11
params:
SUBNET: { get_param: subnet }
port_security_enabled: false
server_1:
dc01:
type: OS::Nova::Server
properties:
diskConfig: AUTO
......@@ -126,12 +126,67 @@ resources:
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "AutoAdminLogon" -PropertyType DWord -Value 1
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "DefaultUserName" -PropertyType String -Value "Administrator"
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "DefaultPassword" -PropertyType String -Value 'password123!@'
#Invoke-WebRequest -Uri "http://10.50.20.28/scripts/setup1.ps1" -OutFile "C:\setup1.ps1"
#Invoke-WebRequest -Uri "http://10.50.20.28/scripts/setup2.ps1" -OutFile "C:\setup2.ps1"
#Invoke-WebRequest -Uri "https://bitskrieg.net/mouse.zip" -OutFile "C:\mouse.zip"
#Set-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce" "setup1" 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -sta -File "C:\setup1.ps1"'
Rename-Computer -NewName $HOSTNAME$ -force
Add-WindowsFeature RSAT-AD-Tools
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools
Import-Module ADDSDeployment
Install-ADDSForest -CreateDnsDelegation:$false -DomainName $DOMAIN$ -InstallDns:$true -NoRebootOnCompletion:$false -Force:$true
exit 1001
params:
$HOSTNAME$: dc01
$DOMAIN$: { get_param: domain }
$SUBNET$: { get_param: subnet }
user_data_format: RAW
dc02_subnet_0_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: network_0 }
fixed_ips:
- ip_address:
str_replace:
template: SUBNET.12
params:
SUBNET: { get_param: subnet }
port_security_enabled: false
dc02:
type: OS::Nova::Server
properties:
diskConfig: AUTO
flavor: cy.large
image: Windows Server 2016
name:
str_replace:
template: DOMAIN_dc02
params:
DOMAIN: { get_param: domain }
networks:
- port: { get_resource: server_1_subnet_0_port }
user_data:
str_replace:
template: |
#ps1_sysnative
$ErrorActionPreference = 'SilentlyContinue'
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
Get-Service -Name TermService | Stop-Service -Force
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 4 /f
Get-Service -Name wuauserv | Start-Service
wuauclt.exe /detectnow /updatenow
net user Administrator password123!@
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "AutoAdminLogon" -PropertyType DWord -Value 1
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "DefaultUserName" -PropertyType String -Value "Administrator"
New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name "DefaultPassword" -PropertyType String -Value 'password123!@'
Rename-Computer -NewName $HOSTNAME$ -force
Add-WindowsFeature RSAT-AD-Tools
Add-WindowsFeature -Name "ad-domain-services" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "dns" -IncludeAllSubFeature -IncludeManagementTools
Add-WindowsFeature -Name "gpmc" -IncludeAllSubFeature -IncludeManagementTools
exit 1001
params:
$HOSTNAME$: dc02
$DOMAIN$: { get_param: domain }
$SUBNET$: { get_param: subnet }
user_data_format: RAW
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment