Currently, I am working on automating an automatic sign off of a specific Horizon Pool via PowerCLI. The sign off functionality works no problem, but I am wanting to send a message to all machines in this pool notifying users that the machines will be logged off in X amount of minutes. The most feasible way to do this via the API seems to be using the session_sendmessages method.
So far, I know I can grab session ids using Get-HVLocalSession. This works fine, but it lists all current session ids, and I only need the ids from a specific desktop pool. If I can figure out how to narrow down the results, I should be able to use the following command via the API documentation:
$Services1.session.Session_SendMessages($session.id, "INFO", "Test message")
Does anyone know of a way to narrow down the results of Get-HVLocalSession to specific desktop pool ids?