Skip to content

Commit

Permalink
Refactor scheduled task creation for WinGetLogonScript and DataOpsLog…
Browse files Browse the repository at this point in the history
…onScript
  • Loading branch information
sebassem committed Jul 18, 2024
1 parent fa8ad62 commit 0d41dcc
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions azure_jumpstart_arcbox/artifacts/RunAfterClientVMADJoin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ $cimsession = New-CimSession -Credential $adminCredential

# Creating scheduled task for WinGet.ps1
$Trigger = New-ScheduledTaskTrigger -AtLogOn -User $adminuser
#$Trigger2 = New-ScheduledTaskTrigger -AtLogOn -CimSession $cimsession
$Action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument $Env:ArcBoxDir\WinGet.ps1
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -RunOnlyIfNetworkAvailable -NetworkName "Any"
#$principal = New-ScheduledTaskPrincipal -RunLevel Highest -GroupId "BUILTIN\Administrators"

Register-ScheduledTask -TaskName "WinGetLogonScript" -Trigger $Trigger -CimSession $cimsession -Action $Action -RunLevel "Highest" -Force -Settings $settings
#Register-ScheduledTask -TaskName "WinGetLogonScript2" -Trigger $Trigger2 -Principal $principal -Action $Action -Force -Settings $settings

# Creating scheduled task for DataOpsLogonScript.ps1
$Action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument "$Env:ArcBoxDir\DataOpsLogonScript.ps1"
Expand Down

0 comments on commit 0d41dcc

Please sign in to comment.