{"id":4260,"date":"2024-10-15T12:58:53","date_gmt":"2024-10-15T11:58:53","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=4260"},"modified":"2024-10-15T12:58:53","modified_gmt":"2024-10-15T11:58:53","slug":"locally-detecting-a-users-sign-in-to-microsoft-teams","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2024\/10\/locally-detecting-a-users-sign-in-to-microsoft-teams\/","title":{"rendered":"Locally detecting a user&#8217;s sign in to Microsoft Teams"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A customer wanted to see when\/if users were doing their first sign in to MS Teams (on new devices), and if this was against their tenant. Mostly untested but for the world since I couldn&#8217;t google it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\nfunction checkTeams(){\n    $teamsLogPath = Join-Path $($env:LOCALAPPDATA) \"packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\ecs_request_param.json\"\n    if((Test-Path $teamsLogPath)){\n        $state = Get-Content $teamsLogPath | ConvertFrom-JSON\n        if($state -and $state.tenantId -eq \"YOUR TENANT GUID\"){\n            return $true\n        }else{\n            return $false\n        }\n    }else{\n        return $false\n    }    \n}\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>A customer wanted to see when\/if users were doing their first sign in to MS Teams (on new devices), and if this was against their tenant. Mostly untested but for the world since I couldn&#8217;t google it:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[4,21,27,39],"tags":[],"class_list":["post-4260","post","type-post","status-publish","format-standard","hentry","category-automation","category-identity","category-microsoft-teams","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/4260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=4260"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/4260\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=4260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=4260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=4260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}