{"id":7498,"date":"2023-11-23T04:32:34","date_gmt":"2023-11-23T04:32:34","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=7498"},"modified":"2023-11-23T04:32:37","modified_gmt":"2023-11-23T04:32:37","slug":"remove-teams-personal-proactive-remediation-intune","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/remove-teams-personal-proactive-remediation-intune","title":{"rendered":"Remove Teams Personal Proactive Remediation Intune"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\">try {\r\n \r\n    $TeamsApp = Get-AppxPackage \"*Teams*\" -AllUsers  -ErrorAction SilentlyContinue\r\n    if ($TeamsApp.Name -eq \"MicrosoftTeams\")\r\n        {\r\n            Write-Host \"Built-in Teams Chat App Detected\"\r\n            Exit 1\r\n        }\r\n    ELSE\r\n        {\r\n            Write-Host \"Built-in Teams Chat App Not Detected\"\r\n            Exit  0\r\n               }\r\n}\r\ncatch {\r\n    $errMsg = $_.Exception.Message\r\n    return $errMsg\r\n    Exit 1\r\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">try\r\n{\r\n$detecta = Get-AppxPackage | select * | where-object {$_ -like \"*MicrosoftTeams*\"}\r\nif ($detecta) {\r\n\"removing $($detecta.Name)\"\r\n Remove-AppxPackage -AllUsers -Package $detecta.PackageFullName\r\n echo \"removed\" | out-file removed.txt\r\nexit 0\r\n} else {\r\n    \"do nothing\"\r\n    exit 0\r\n    }\r\n }\r\ncatch{\r\n    $errMsg = $_.Exception.Message\r\n    Write-Error $errMsg\r\n    exit 1\r\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7498","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=7498"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7498\/revisions"}],"predecessor-version":[{"id":7499,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7498\/revisions\/7499"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=7498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=7498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=7498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}