-1

I have set up a Microsoft Teams GPO deployment using a .msi. Unfortunately some users have already installed teams using the .exe installer.

This then creates issues with the .msi deployment as when the GPO sees the .exe files it does not apply.

Does anyone have a script that will delete all references to teams.exe within a users roaming profile?

Many thanks

Stan
  • 1
  • 2

1 Answers1

0

This command will list all files with full path in Users' AppData\Roaming\Microsoft\Teams folder (recursive) and will delete all files that match with "\teams.exe"

Get-ChildItem "C:\Users\*\AppData\Roaming\Microsoft\Teams\*" -Recurse | ForEach{if($_.FullName -match '\\teams.exe'){Remove-Item "$($_.FullName)" -Force -WhatIf}}

Note: I added "-WhatIf" at the end of the command to avoid any mistake before running the command for real. So you have to remove "-WhatIf" after checking the result with "-WhatIf"

HoLengZai
  • 301
  • 3
  • 13