diff --git a/source/orchestrationLogic/HEAT/bootup.ps1 b/source/orchestrationLogic/HEAT/bootup.ps1 index 2947e7e7527e41573f7c1cd6ff7d5c960e58b1cb..8bc4ebfc304db01bea503fd527b47fdfb4dc4971 100644 --- a/source/orchestrationLogic/HEAT/bootup.ps1 +++ b/source/orchestrationLogic/HEAT/bootup.ps1 @@ -22,6 +22,8 @@ if( !(Test-Path -Path "C:\flag.txt")) { $usr = "$dc\Administrator" $creds = New-Object System.Management.Automation.PSCredential($usr,$pw) + $added = $true + $i = 0; do { try { Add-Computer -DomainName $dc -Credential $creds -ErrorAction Stop @@ -38,6 +40,22 @@ if( !(Test-Path -Path "C:\flag.txt")) { }else { echo "else" - <RDPMembers> # Adds users to the rdp member group + $added = $true + $i = 0; + do{ + + try{ + <RDPMembers> # Adds users to the rdp member group + echo "adding succeeded" + + } catch { + echo "adding faled retrying in one minute" + $added = $false + $i = $i + 1 + Start-Sleep -s 60 + } + + } while((-Not $added) -And ($i -lt 10)) + } diff --git a/source/orchestrationLogic/orchestrator.py b/source/orchestrationLogic/orchestrator.py index 0c2b7838c55619c2349faa32e63d88ce3cfd107b..f639a59fc8c6aa30b2b4dc3db11b60d253cb9923 100644 --- a/source/orchestrationLogic/orchestrator.py +++ b/source/orchestrationLogic/orchestrator.py @@ -158,6 +158,6 @@ class Orchestrator: def allowRDP(self, members): result = '' for member in members: - result += "Add-LocalGroupMember -Group 'Remote Desktop Users' -Member '{}';".format(member) + result += "Add-LocalGroupMember -Group 'Remote Desktop Users' -Member '{}' -ErrorAction Stop;".format(member) return result