Do you know if it’s possible to somehow trigger a refresh or Sync-UDElement to all connected PSU sessions? If yes, how?
I know that for example you can broadcast a UDToast Message to all sessions. So I suppose this would be somehow possible too…
Our use case why this would be useful:
As probably many of you we have an AD Dashboard for unlocking / resetting user accounts.
Obviously if we have many operators connected and all of them look at their own dashboard, they will see that a user XYZ is locked. Now maybe operator1 will go ahead and unlock the user. The table will then automatically refresh for him and the former locked user will be gone.
However another operator ha still the “old” search results that show up and the table will only refresh after 2 minutes… so the unlock button is still visible and he will be able to perform the “dummy” operation as well. Since we audit log all activity this will “fake” the report because we will see that user XYZ has been unlocked twice in the same minute by two different operators.
It would therefore be more professional if the table would automatically refresh on all open dashboards so that everybody sees the same actual information.
Currently I’ve added a check on the button, so in your example Don when the 2nd person clicks the unlock button it checks to see if the user still requires unlocking and if not (i.e. someone else has already unlocked the user) then display a modal “user has already been unlocked” (or something) and then refresh the table.
Hi @pharnos
Thanks a lot for your reply. Indeed this is also a good solution and I think you’re right… Probably the most clean one.
Alright I’ll go ahead and add this additional check.
Adam replied on another thread, this works to update dynamic elements across all logged in people’s dashboards (where the element’s Id is the same)
You can use Sync-UDElement -Id 'name' -Broadcast to send it to all users of the dashboard. You can use Sync-PSUComponent from within a job or API to sync all connected users to all dashboards.
In this circumstance, I might recommend Sync-PSUComponent because even jobs run from the admin console would cause dashboards to reload.
Hi @pharnos
Thanks mate! That is brilliant! Will give it a try! I think that even if I was able to workaround it as you mentioned before (check if account is still locked-out) we could always have potential situations where you cannot “easily” do checks and re-checks all the time but a broadcasted Sync-UDElement would do the job better…