Jump to content
Welcome to our new Citrix community!
  • 0

WEM External Task at Logoff


Maximilian Matt

Question

Hi everybody,

I'm trying to run an external task (PSTest), a powershell script with the settings Run once and at Logoff.

The script runs fine when i unselect Run once at logoff, so my task definition is correct and works.

 

Version:  VDA1912 LTRS CU3, on Server 2019, WEM 2012

 

However, when i select Run once it wont work, the log states:

 

Citrix WEM Agent.log
 

<...>

11:35:15 Event -> VuemExternalTaskController.ProcessSingleEntityTask() : External Task -> PSTest found for Item: DOMAIN\testi (SID)
11:35:15 Event -> VuemExternalTaskController.() : Settings: executeAtLogon: False, executeAtLogoff: True, executeWhenRefresh: False, executeWhenReconnect: False
11:35:15 Event -> VuemExternalTaskController.() : External Task: PSTest Configured to be executed not at logon but logon detected -> Skipping execution

<...>

 

Citrix WEM Agent Logoff.log

<...>

11:38:53 Event -> VuemExternalTaskController.ProcessSingleEntityTask() : External Task -> PSTest found for Item: DOMAIN\testi (SID)

11:38:53 Event -> VuemExternalTaskController.ProcessSingleEntityTask() : External Task -> Teams desktop-config.json Anpassungen found for Item: DOMAIN\testi (SID)
11:38:53 Event -> VuemExternalTaskController.() : Settings: executeAtLogon: True, executeAtLogoff: False, executeWhenRefresh: True, executeWhenReconnect: True
11:38:53 Event -> VuemExternalTaskController.() : Settings: executeAtLogon: True, executeAtLogoff: False, executeWhenRefresh: True, executeWhenReconnect: True
11:38:53 Event -> VuemExternalTaskController.() : Settings: executeAtLogon: False, executeAtLogoff: True, executeWhenRefresh: False, executeWhenReconnect: False
11:38:53 Event -> VuemExternalTaskController.() : External Task: Signaturskript Configured to be executed not at logoff but logoff detected -> Skipping execution
11:38:53 Event -> VuemExternalTaskController.() : External Task: Signal Installieren Configured to be executed not at logoff but logoff detected -> Skipping execution
11:38:53 Event -> VuemExternalTaskController.() : Settings: executeAtLogon: False, executeAtLogoff: True, executeWhenRefresh: False, executeWhenReconnect: False
11:38:53 Event -> VuemExternalTaskExecutor.ProcessAssociatedTaskMethod() : Processing External Task -> Teams desktop-config.json Anpassungen (Id:10)
11:38:53 Event -> VuemExternalTaskExecutor.ProcessAssociatedTaskMethod() : Processing External Task -> PSTest (Id:14)
11:38:53 Event -> VuemFilterController.GetFilterRuleState() : Now Starting Filter Rule Processing -> Filter Rule Id : 1
11:38:53 Event -> VuemFilterController.GetFilterRuleState() : Now Starting Filter Rule Processing -> Filter Rule Id : 1
11:38:53 Event -> VuemFilterController.GetFilterRuleState() : Default 'Always True' Filter Rule (Id:1) Detected -> Returning True Value
11:38:53 Event -> VuemFilterController.GetFilterRuleState() : Default 'Always True' Filter Rule (Id:1) Detected -> Returning True Value
11:38:53 Event -> VuemExternalTaskExecutor.CheckExecCacheState() : External Task -> Teams desktop-config.json Anpassungen (Id:10) -> Action already processed -> returning true
11:38:53 Event -> VuemExternalTaskExecutor.CheckExecCacheState() : External Task -> PSTest (Id:14) -> Action already processed -> returning true
11:38:53 Event -> VuemExternalTaskController.ProcessActionRelatedRefresh() : External Task Processing: No Refresh required -> Exiting
11:38:53 Event -> MainController.ProcessLogoffMethods() : Agents Tasks End

 

As you can see, WEM thinks it has already executed this task and wont run it again, which would be awesome, if it'd be correct...

Is this a known bug or is there something wrong with our setup?

Has anyone experienced that before?

Link to comment

2 answers to this question

Recommended Posts

  • 0

If it’s run once and you haven’t cleared that status then it’s doing exactly what it should be doing -  you can reset this status in the user session by right clicking the wem agent and choosing reset actions, or from the console - effectively making wem think it’s never run  

 

the status is stored in the user registry

Link to comment
  • 0

Hi James,

 

the problem is: it does not run once - it just logs it and dont execute.

I created a whole new user for testing (so no "old" registry around) and it won't execute, but it somehow things it already did.

 

I did it once again and checked the registry like you described here https://jkindon.com/2018/11/28/selective-deletion-of-the-wem-actions-tracking-cache/

  • I deleted the whole Profile disk (FSLogix)
  • logged in, waited a minute, then checked this registry entry: HKEY_CURRENT_USER\SOFTWARE\VirtuAll Solutions\VirtuAll User Environment Manager\Agent\Tasks Exec Cache\ExternalTasks -> there is no entry for my skript (maybe thats my problem?) but I think thats ok, because I only logged on, not off.
  • Citrix WEM Agent Log states the same thing as posted above, at this time, there is no WEM Agent Logoff Log
  • WEM Actions Viewer states my PSTest-Task as Excluded Action too
  • Now I log off
  • I wait for a few seconds and now there is the WEM Agent Logoff Log created
  • In this is log it states that it has already processed my task (see above)

-> I don't get anywhere a hint that it does execute it, nor does my testfile get created, yet it states that it already executed it.

 

My testscript:

$content = Get-Date -Format 'yyyy-MM-dd hh:mm:ss'

Out-File -FilePath "$env:APPDATA\testdatei.txt" -InputObject $content -Encoding UTF8 -Append -Force

 

So after that, as a step to check if my task is setup correctly, I unchecked the Run Once option and now it executes fine -  so my task (and script) should be correct.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...