Forum Discussion
Bridget_T
Nov 12, 2024Brass Contributor
script to use PowerShell to Report Teams Status, Presence and Reset After Time
I would like to create a powershell script to run against my tenant to report where people have got a Reset Status After time coded in Teams Any suggestions - greatfully received. I can only fin...
- Nov 18, 2024
Hi Bridget_T ,
This is more of a Teams question than a PowerShell question, so you might want to also ask this in a Teams forum.
Having had a read of the v1 and beta Graph presence endpoint, I does not seem that what you are wanting to do is possible. This is for two reasons:
- Teams can have multiple clients connected to it, where each client is responsible for managing its own polling and setting of the per session status;
- The "set presence" endpoint does not support a value for "reset status", adding weight to the above point that this is not managed service-side, but rather within each client's session.
Because the "reset" behaviour is being actioned by each client, that means there is nothing to query from the service itself, which is reflected in the "get presence" endpoint where the JSON response contains no such data.
Put another way: Setting a reset value within the Teams desktop client means its then that desktop client's responsibility to perform the reset behaviour. If you concurrently ran Teams mobile and Teams web, they would be unaware of the reset value from Teams desktop. Similarly, there is nothing to query from the Teams service since it's the Teams desktop client holding these settings and actioning the behaviour.
Reference articles:
- presence: setPresence - Microsoft Graph beta | Microsoft Learn
- Get presence - Microsoft Graph beta | Microsoft Learn
As I mentioned earlier though, it would be worth your while asking in a Teams forum, where you might expect to find more Teams-proficient people. Another option might be to ask in a Power Platform forum, as Power Platform solutions are a prolific consumer of Graph endpoints.
In not being a Teams afficionado, and going off the Graph endpoint documentation, I can't see a way to achieve what you're hoping to achieve.
Cheers,
Lain
LainRobertson
Nov 18, 2024Silver Contributor
Hi Bridget_T ,
This is more of a Teams question than a PowerShell question, so you might want to also ask this in a Teams forum.
Having had a read of the v1 and beta Graph presence endpoint, I does not seem that what you are wanting to do is possible. This is for two reasons:
- Teams can have multiple clients connected to it, where each client is responsible for managing its own polling and setting of the per session status;
- The "set presence" endpoint does not support a value for "reset status", adding weight to the above point that this is not managed service-side, but rather within each client's session.
Because the "reset" behaviour is being actioned by each client, that means there is nothing to query from the service itself, which is reflected in the "get presence" endpoint where the JSON response contains no such data.
Put another way: Setting a reset value within the Teams desktop client means its then that desktop client's responsibility to perform the reset behaviour. If you concurrently ran Teams mobile and Teams web, they would be unaware of the reset value from Teams desktop. Similarly, there is nothing to query from the Teams service since it's the Teams desktop client holding these settings and actioning the behaviour.
Reference articles:
- presence: setPresence - Microsoft Graph beta | Microsoft Learn
- Get presence - Microsoft Graph beta | Microsoft Learn
As I mentioned earlier though, it would be worth your while asking in a Teams forum, where you might expect to find more Teams-proficient people. Another option might be to ask in a Power Platform forum, as Power Platform solutions are a prolific consumer of Graph endpoints.
In not being a Teams afficionado, and going off the Graph endpoint documentation, I can't see a way to achieve what you're hoping to achieve.
Cheers,
Lain
Bridget_T
Nov 18, 2024Brass Contributor
Thanks for the update.