คู่มือและสคริปต์การถอนการติดตั้ง ติดตั้งใหม่ และล้างข้อมูล Microsoft Teams
Microsoft Teams ไม่เหมือนกับโปรแกรมทั่วไปของคุณเมื่อต้องติดตั้งและถอนการติดตั้ง ปัญหาของ Microsoft Teams คือมีการติดตั้งสำหรับผู้ใช้ทุกคนใน AppData ของผู้ใช้ (หรือข้อมูลโปรแกรมในบางครั้ง) นอกจากนี้เรายังมีตัวติดตั้งทั้งเครื่องของ Microsoft Teams ซึ่งจะติดตั้ง Teams โดยอัตโนมัติเมื่อผู้ใช้เข้าสู่ระบบ
การทำความสะอาดสิ่งต่างๆ ด้วย Microsoft Teams อาจเป็นเรื่องที่ท้าทายมาก ฉันลองยกตัวอย่างเพื่อลบและติดตั้ง Teams ใหม่สำหรับผู้ใช้เมื่อเร็วๆ นี้ ผู้ใช้ได้รับข้อผิดพลาด การติดตั้ง Microsoft Teams ล้มเหลวในการอัปเดต Microsoft Teams ทุกครั้ง
หลังจากลบทุกอย่างและติดตั้ง Teams ใหม่ เขาก็พบแอป Teams ที่ว่างเปล่า ดังนั้นจึงไม่มีประวัติการแชทและไม่มีช่องทาง Teams อีกต่อไป (แม้ว่าทุกอย่างจะยังมองเห็นได้ทางออนไลน์ก็ตาม)
ในบทความนี้ ฉันจะให้คำแนะนำและสคริปต์ในการลบและล้าง Teams เพื่อให้คุณสามารถติดตั้งใหม่ได้อีกครั้ง
ทำให้ Teams สนุกยิ่งขึ้นอีกเล็กน้อยด้วยพื้นหลังตลกๆ เหล่านี้สำหรับ Microsoft Teams
แก้ไขการติดตั้ง Microsoft Teams ล้มเหลว
ข้อผิดพลาดที่พบบ่อยที่สุดประการหนึ่งกับ Microsoft Teams คือข้อผิดพลาดในการติดตั้งล้มเหลว ซึ่งอาจปรากฏขึ้นเมื่อ Teams พยายามอัปเดต ข้อผิดพลาดนี้อาจกลับมาอีกทุกครั้งที่มีการอัปเดตและค่อนข้างน่ารำคาญ
เพียงติดตั้ง Teams ใหม่อีกครั้งก็ไม่ใช่วิธีแก้ปัญหา มันจะใช้งานได้ในตอนนี้ แต่ข้อผิดพลาดอาจปรากฏขึ้นอีกครั้งในการอัพเดตครั้งถัดไป
วิธีเดียวที่จะแก้ไขปัญหาได้คือการลบแคชในเครื่องและรีสตาร์ท Microsoft Teams:
- ปิดทีม Microsoft
- กด ปุ่ม Windows + R
- พิมพ์ %appdata% แล้วกด Enter
- เปิดโฟลเดอร์ Microsoft
- ลบ โฟลเดอร์ ทีม
5. รีสตาร์ททีม
คุณยังสามารถใช้สคริปต์ PowerShell ด้านล่างเพื่อลบ Microsoft Teams Cache
การถอนการติดตั้ง Microsoft Teams
เราเริ่มต้นด้วยส่วนที่ง่าย เพียงถอนการติดตั้ง Microsoft Teams บางคนแสดงความคิดเห็นว่า Microsoft Teams ของตนทำการติดตั้งใหม่อย่างต่อเนื่องหลังจากที่ถอนการติดตั้งแล้ว กรณีนี้ส่วนใหญ่เกิดจากโปรแกรมติดตั้งทั้งเครื่อง
ดังนั้น หากต้องการถอนการติดตั้ง Microsoft Teams โดยสมบูรณ์ คุณจะต้องลบทั้ง Microsoft Teams และ Teams Machine-Wide Installer
- เปิด การตั้งค่า > แอป > แอปและคุณลักษณะ
- ค้นหาทีม
- ลบแอปทั้งหมด (ใช่ ฉันมีตัวติดตั้งทั้งเครื่องสองตัว… ไม่ต้องถามว่าทำไม)
ถอนการติดตั้ง Microsoft Teams ด้วย PowerShell
ฉันชอบทำให้สิ่งต่างๆ เป็นอัตโนมัติมากที่สุดเท่าที่จะเป็นไปได้ ดังนั้นแน่นอนว่าเรายังมีสคริปต์ PowerShell เพื่อถอนการติดตั้ง Microsoft Teams ด้วย
สคริปต์จะลบตัวติดตั้งทั้งเครื่องและตัว Microsoft Teams ตรวจสอบให้แน่ใจว่าคุณเรียกใช้สคริปต์ PowerShell ในโหมดยกระดับ คุณสามารถทำได้โดยเปิด PowerShell ในฐานะผู้ดูแลระบบ
function unInstallTeams($path) {
$clientInstaller = "$($path)\Update.exe"
try {
$process = Start-Process -FilePath "$clientInstaller" -ArgumentList "--uninstall /s" -PassThru -Wait -ErrorAction STOP
if ($process.ExitCode -ne 0)
{
Write-Error "UnInstallation failed with exit code $($process.ExitCode)."
}
}
catch {
Write-Error $_.Exception.Message
}
}
# Remove Teams Machine-Wide Installer
Write-Host "Removing Teams Machine-wide Installer" -ForegroundColor Yellow
$MachineWide = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Teams Machine-Wide Installer"}
$MachineWide.Uninstall()
# Remove Teams for Current Users
$localAppData = "$($env:LOCALAPPDATA)\Microsoft\Teams"
$programData = "$($env:ProgramData)\$($env:USERNAME)\Microsoft\Teams"
If (Test-Path "$($localAppData)\Current\Teams.exe")
{
unInstallTeams($localAppData)
}
elseif (Test-Path "$($programData)\Current\Teams.exe") {
unInstallTeams($programData)
}
else {
Write-Warning "Teams installation not found"
}สคริปต์จะตรวจสอบตำแหน่งการติดตั้งที่เป็นไปได้สองตำแหน่งของทีม และลบออกเมื่อพบ
หากคุณต้องการเรียกใช้สคริปต์นี้สำหรับผู้ใช้หลายคน (บนคอมพิวเตอร์เครื่องเดียวกัน) คุณสามารถใช้ส่วนต่อไปนี้แทนส่วนลบทีมสำหรับผู้ใช้ปัจจุบัน:
# Get all Users
$Users = Get-ChildItem -Path "$($ENV:SystemDrive)\Users"
# Process all the Users
$Users | ForEach-Object {
Write-Host "Process user: $($_.Name)" -ForegroundColor Yellow
#Locate installation folder
$localAppData = "$($ENV:SystemDrive)\Users\$($_.Name)\AppData\Local\Microsoft\Teams"
$programData = "$($env:ProgramData)\$($_.Name)\Microsoft\Teams"
If (Test-Path "$($localAppData)\Current\Teams.exe")
{
unInstallTeams($localAppData)
}
elseif (Test-Path "$($programData)\Current\Teams.exe") {
unInstallTeams($programData)
}
else {
Write-Warning "Teams installation not found for user $($_.Name)"
}
}ถอนการติดตั้งตัวติดตั้งทั้งเครื่องของ Teams
เพื่อให้ชัดเจน คุณสามารถถอนการติดตั้งตัวติดตั้งทั้งเครื่องของ Teams ได้อย่างปลอดภัย สิ่งที่คุณทำได้คือติดตั้ง Teams ให้กับผู้ใช้ทุกคนที่ลงชื่อเข้าใช้
คุณสามารถถอนการติดตั้งตัวติดตั้งทั้งเครื่องของ Teams ได้ในหน้าจอการตั้งค่าหรือด้วยสคริปต์ PowerShell
- เปิด การตั้งค่า > แอป > แอปและคุณลักษณะ
- ค้นหาทีม
- ถอนการติดตั้งโปรแกรมติดตั้งทั้งเครื่องของ Teams
คุณยังสามารถลบตัวติดตั้ง Teams Machine-Wide ด้วย PowerShell ได้อีกด้วย สิ่งนี้มีประโยชน์มากหากคุณต้องการลบออกจากคอมพิวเตอร์หลายเครื่อง ตรวจสอบให้แน่ใจว่าคุณเรียกใช้สคริปต์ PowerShell ในโหมดยกระดับ
คุณสามารถเปิด PowerShell ในฐานะผู้ดูแลระบบได้จากเมนูเริ่มต้น
# Remove Teams Machine-Wide Installer
Write-Host "Removing Teams Machine-wide Installer" -ForegroundColor Yellow
$MachineWide = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Teams Machine-Wide Installer"}
$MachineWide.Uninstall()Microsoft Teams ล้างแคช
ดังนั้นฉันจึงมีโอกาสต้องลบ Microsoft Teams สำหรับผู้ใช้ แต่หลังจากติดตั้ง Teams ใหม่ กลับไม่มีประวัติ วิธีแก้ปัญหาเดียวในการแก้ไขปัญหานี้คือการล้างแคชของ Microsoft Teams
ปัญหาคือไม่มีที่เดียวสำหรับแคชของ Microsoft Teams ฉันคาดว่ามันจะอยู่ใน AppData ที่โรมมิ่ง แต่กลับกลายเป็นว่าไม่ใช่เพียงตำแหน่งเดียว เราจำเป็นต้องล้าง Chrome และ Edge Cache เพื่อลบออกโดยสมบูรณ์
Mark Vale ได้สร้างสคริปต์ PowerShell ที่ดีมากเพื่อล้างแคช Microsoft Teams ดังนั้นเราจะใช้สิ่งนั้น:
# Author: Mark Vale
$clearCache = Read-Host "Do you want to delete the Teams Cache (Y/N)?"
$clearCache = $clearCache.ToUpper()
if ($clearCache -eq "Y"){
Write-Host "Stopping Teams Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName Teams | Stop-Process -Force
Start-Sleep -Seconds 3
Write-Host "Teams Process Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing Teams Disk Cache" -ForegroundColor Yellow
try{
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\application cache\cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\blob_storage" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\databases" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\gpucache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Indexeddb" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Local Storage" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\tmp" | Remove-Item -Confirm:$false
Write-Host "Teams Disk Cache Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Stopping Chrome Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName Chrome| Stop-Process -Force
Start-Sleep -Seconds 3
Write-Host "Chrome Process Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing Chrome Cache" -ForegroundColor Yellow
try{
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cookies" -File | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Web Data" -File | Remove-Item -Confirm:$false
Write-Host "Chrome Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Stopping IE Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName MicrosoftEdge | Stop-Process -Force
Get-Process -ProcessName IExplore | Stop-Process -Force
Write-Host "Internet Explorer and Edge Processes Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing IE Cache" -ForegroundColor Yellow
try{
RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 2
Write-Host "IE and Edge Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Cleanup Complete... Launching Teams" -ForegroundColor Green
Start-Process -FilePath $env:LOCALAPPDATA\Microsoft\Teams\current\Teams.exe
Stop-Process -Id $PID
}สคริปต์นี้จะล้างแคชของ Microsoft Teams และรีสตาร์ท Teams เมื่อเสร็จสิ้นเท่านั้น
คุณยังสามารถรวมสคริปต์ล้างข้อมูลและลบเพื่อทำทุกอย่างได้ในคราวเดียว:
# Clearing Teams Cache by Mark Vale
# Uninstall Teams by Rudy Mens
$clearCache = Read-Host "Do you want to delete the Teams Cache (Y/N)?"
$clearCache = $clearCache.ToUpper()
$uninstall= Read-Host "Do you want to uninstall Teams completely (Y/N)?"
$uninstall= $uninstall.ToUpper()
if ($clearCache -eq "Y"){
Write-Host "Stopping Teams Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName Teams | Stop-Process -Force
Start-Sleep -Seconds 3
Write-Host "Teams Process Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing Teams Disk Cache" -ForegroundColor Yellow
try{
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\application cache\cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\blob_storage" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\databases" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\gpucache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Indexeddb" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Local Storage" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\tmp" | Remove-Item -Confirm:$false
Write-Host "Teams Disk Cache Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Stopping Chrome Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName Chrome| Stop-Process -Force
Start-Sleep -Seconds 3
Write-Host "Chrome Process Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing Chrome Cache" -ForegroundColor Yellow
try{
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cache" | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cookies" -File | Remove-Item -Confirm:$false
Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Web Data" -File | Remove-Item -Confirm:$false
Write-Host "Chrome Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Stopping IE Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName MicrosoftEdge | Stop-Process -Force
Get-Process -ProcessName IExplore | Stop-Process -Force
Write-Host "Internet Explorer and Edge Processes Sucessfully Stopped" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Clearing IE Cache" -ForegroundColor Yellow
try{
RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 2
Write-Host "IE and Edge Cleaned" -ForegroundColor Green
}catch{
echo $_
}
Write-Host "Cleanup Complete..." -ForegroundColor Green
}
if ($uninstall -eq "Y"){
Write-Host "Removing Teams Machine-wide Installer" -ForegroundColor Yellow
$MachineWide = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -eq "Teams Machine-Wide Installer"}
$MachineWide.Uninstall()
function unInstallTeams($path) {
$clientInstaller = "$($path)\Update.exe"
try {
$process = Start-Process -FilePath "$clientInstaller" -ArgumentList "--uninstall /s" -PassThru -Wait -ErrorAction STOP
if ($process.ExitCode -ne 0)
{
Write-Error "UnInstallation failed with exit code $($process.ExitCode)."
}
}
catch {
Write-Error $_.Exception.Message
}
}
#Locate installation folder
$localAppData = "$($env:LOCALAPPDATA)\Microsoft\Teams"
$programData = "$($env:ProgramData)\$($env:USERNAME)\Microsoft\Teams"
If (Test-Path "$($localAppData)\Current\Teams.exe")
{
unInstallTeams($localAppData)
}
elseif (Test-Path "$($programData)\Current\Teams.exe") {
unInstallTeams($programData)
}
else {
Write-Warning "Teams installation not found"
}
}ห่อขึ้น
ฉันหวังว่าสคริปต์เหล่านี้จะช่วยคุณลบและล้างข้อมูล Microsoft Teams หากคุณต้องการติดตั้ง Microsoft Teams ใหม่ โปรดอ่านบทความนี้
หากคุณมีคำถามใด ๆ เพียงแค่แสดงความคิดเห็นด้านล่าง
ขอขอบคุณ Mark Vale อีกครั้งสำหรับสคริปต์การล้างข้อมูล!



