Hi there,
Wondering if it’s possible to check if “Applying computer settings” is done via vagrant/powershell.
I’m currently trying to install my domain controller and automate the creation of organisational units/users/groups through more scripts.
After the AD install the VM needs a reboot to be able to run those extra scripts.
Is there a way? I’m currently setting a sleep time of aprox 6 minutes to bypass my scripts not waiting for the “Applying computer settings”.
This is the part in my vagrantFile where I need the reboot and the scripts running after it:
# Provision everything on the first run
cfg.vm.provision "shell" do |s|
s.path = "scripts/01_install_ad.ps1"
s.privileged = false
s.args = [var_domain_name, var_domain_mode, var_public_ip, var_public_dns1, var_default_password]
end
# reboot server after AD role deploy
cfg.vm.provision "shell", reboot: true
cfg.vm.provision "shell", path: "scripts/02_createOU.ps1", privileged: false
cfg.vm.provision "shell", path: "scripts/03_createUsers.ps1", privileged: false
cfg.vm.provision "shell", path: "scripts/04_policies.ps1", privileged: false
Bypass the waiting script:
Write-Host "Waiting until system fully booted"
Start-Sleep -s 360
New-ADOrganizationalUnit -Name "IT Administratie" -Path "DC=CORONA,DC=local"
New-ADOrganizationalUnit -Name "Verkoop" -Path "DC=CORONA,DC=local"
New-ADOrganizationalUnit -Name "Administratie" -Path "DC=CORONA,DC=local"
New-ADOrganizationalUnit -Name "Ontwikkeling" -Path "DC=CORONA,DC=local"
New-ADOrganizationalUnit -Name "Directie" -Path "DC=CORONA,DC=local"
Hope someone can help me!