From 8051bd57323e5d6d2fc6153dbf7acb153b68c3b0 Mon Sep 17 00:00:00 2001
From: Marius Raes <mariusraes@Mariuss-MacBook-Air.local>
Date: Mon, 16 May 2022 15:07:52 +0200
Subject: [PATCH] 15 min sleep

---
 source/orchestrationLogic/HEAT/bootup.ps1  | 13 +++++++++----
 source/orchestrationLogic/HEAT/dc-init.ps1 | 15 +++++++--------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/source/orchestrationLogic/HEAT/bootup.ps1 b/source/orchestrationLogic/HEAT/bootup.ps1
index 4c0ae33d..b4c7c418 100644
--- a/source/orchestrationLogic/HEAT/bootup.ps1
+++ b/source/orchestrationLogic/HEAT/bootup.ps1
@@ -1,4 +1,5 @@
 #ps1_sysnative
+Start-Sleep -s 1800
 echo custom-script
 if( !(Test-Path -Path "C:\flag.txt")) {
     New-Item -Path "C:\flag.txt"
@@ -22,7 +23,7 @@ if( !(Test-Path -Path "C:\flag.txt")) {
     $usr = "$dc\Administrator"
     $creds = New-Object System.Management.Automation.PSCredential($usr,$pw)
 
-    $added = $true
+    $joined = $true
     $i = 0;
     do {
         try {
@@ -36,9 +37,13 @@ if( !(Test-Path -Path "C:\flag.txt")) {
         echo "`n`n DOMAIN JOIN FAILED RETRYING IN 1 MINUTE `n`n"
         Start-Sleep -s 60
         }
-} while ((-Not $joined) -And ($i -lt 25))
+    } while ((-Not $joined) -And ($i -lt 25))
 
 }else {
-    Start-Sleep -s 600
-    <RDPMembers> # Adds users to the rdp member group
+    $i = 0
+    do {
+        <RDPMembers> # Adds users to the rdp member group
+        $i = $i+1
+
+    } while($i -lt 10)
 }
diff --git a/source/orchestrationLogic/HEAT/dc-init.ps1 b/source/orchestrationLogic/HEAT/dc-init.ps1
index fc71f58d..20a0d42f 100644
--- a/source/orchestrationLogic/HEAT/dc-init.ps1
+++ b/source/orchestrationLogic/HEAT/dc-init.ps1
@@ -22,13 +22,12 @@ if( !(Test-Path -Path "C:\flag.txt")) {
     exit 1003
 }else {
     echo "else"
-    New-Item -Path "C:\log.txt"
 
-    New-ADUser -Name "bojack" -Accountpassword (ConvertTo-SecureString "HorsemanPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "diane" -Accountpassword (ConvertTo-SecureString "NguyenPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "todd" -Accountpassword (ConvertTo-SecureString "ChavezPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "sarah" -Accountpassword (ConvertTo-SecureString "LynnPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "hollyhock" -Accountpassword (ConvertTo-SecureString "ManheimPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "wanda" -Accountpassword (ConvertTo-SecureString "PiercePass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
-    New-ADUser -Name "pinky" -Accountpassword (ConvertTo-SecureString "PenguinPass1" -AsPlainText -Force ) -Enabled $true >> C:\log.txt
+    New-ADUser -Name "bojack" -Accountpassword (ConvertTo-SecureString "HorsemanPass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "diane" -Accountpassword (ConvertTo-SecureString "NguyenPass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "todd" -Accountpassword (ConvertTo-SecureString "ChavezPass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "sarah" -Accountpassword (ConvertTo-SecureString "LynnPass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "hollyhock" -Accountpassword (ConvertTo-SecureString "ManheimPass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "wanda" -Accountpassword (ConvertTo-SecureString "PiercePass1" -AsPlainText -Force ) -Enabled $true
+    New-ADUser -Name "pinky" -Accountpassword (ConvertTo-SecureString "PenguinPass1" -AsPlainText -Force ) -Enabled $true
 }
-- 
GitLab