This message was deleted.
# _general
s
This message was deleted.
j
There's a "RunLevel" property in the XML file, but switching it to "HighestPrivilege" doesn't work
OK, answered my own question 🙂 It is the XML property and needs to be set to "HighestAvailable"
👍 1
n
Was gonna suggest using PS to create the task, since you can use -RunLevel Highest for that.
(I know, not the same as importing...)
j
Would probably be best in the long run, but for now, the olde methods are first choice for middle-aged admins like myself 🙂
n
The only reason I switched is because I couldn't get the import to work if you wanted to use the SYSTEM account to run the task.
j
That'll probably be my driver as well, when it comes to it
n
In that case:
Copy code
$Action = New-ScheduledTaskAction -Execute 'C:\Program Files (x86)\Citrix\Workspace Environment Management Agent\RefreshCache.bat'
$Trigger =  New-ScheduledTaskTrigger -AtStartup
$Settings = New-ScheduledTaskSettingsSet -Hidden
Register-ScheduledTask -Action $Action -Trigger $Trigger -TaskName "WEM - RefreshCache" -Description "Refresh the WEM Agent cache" -Settings $Settings -User SYSTEM -RunLevel Highest
👍 1
j
How do you set New-ScheduledTaskTrigger to be on an event ID?
n
That I don't know. Haven't had to go that route yet.
k
@James Rankin I can hook you up with that :) Look at workaround 1: https://virtualwarlock.net/how-to-install-the-fslogix-apps-agent/
n
If it's based on an Event ID, I found exporting the scheduled task and importing it with PowerShell works better. My PoSH is
Register-ScheduledTask -Xml (Get-Content '<path to xml>' | out-string) -TaskName '<Task Name>'
j
@Kasper Johansen whoa that's too complex for a Thursday afternoon 🙂
Thanks @Nathan Sperry
Lots of stuff to plough through here 🙂
n
Today's Thursday?
j
I hope so, otherwise I've been working too long
😄 1