Forum Discussion
MS Teams logout issue
Hi,
I have an issue with the MS Team login.
I have 2 account
1. From IT Team
2. Reigning Champs
on the same email. I have successfully login into both accounts. But whenever my system restart. Champs accounts are not opening. It is giving an error. But IT account always open in the MS team.
I have cleared data
Clear MS Team Cache:
%AppData%\Microsoft\teams\application cache\cache
%AppData%\Microsoft\teams\blob_storage
%AppData%\Microsoft\teams\databases
%AppData%\Microsoft\teams\cache
%AppData%\Microsoft\teams\gpucache
%AppData%\Microsoft\teams\Indexeddb
%AppData%\Microsoft\teams\Local Storage
%AppData%\Microsoft\teams\tmp
%LocalAppData%\Google\Chrome\User Data\Default\Cache
%LocalAppData%\Google\Chrome\User Data\Default\Cookies
%LocalAppData%\Google\Chrome\User Data\Default\Web Data
But there is going to the same account to champs account.
when un-install then it will work but sometimes is not work. My local system is working fine. but the office system is not working.
I didn't find any correct solutions also there are not correct solutions every time un-install the MS team.
Very bad experience with MS team. I think I will not refer to this. there it, not any clear cache to clear the account and go to Champs account.
Sorry about that
Thanks
Rajput Vikash Rana
try this powershell script:
#Stop Teams process
Get-Process -ProcessName Teams -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Seconds 3
Write-Host "Teams Process Sucessfully Stopped"
#Clear Team Cache
try{
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\blob_storage" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\databases" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\cache" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\gpucache" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Indexeddb" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Local Storage" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\tmp" | Remove-Item -Recurse -ErrorAction SilentlyContinue
Write-Host "Teams Cache Cleaned"
}catch{
echo $_
}
#Remove Credential from Credential manager
$credential = cmdkey /list | ForEach-Object{if($_ -like "*Target:*" -and $_ -like "*msteams*"){cmdkey /del:($_ -replace " ","" -replace "Target:","")}}
#Remove Reg.Key
$Regkeypath= "HKCU:\Software\Microsoft\Office\Teams"
$value = (Get-ItemProperty $Regkeypath).HomeUserUpn -eq $null
If ($value -eq $False)
{
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "HomeUserUpn"
Write-Host "The registry value Sucessfully removed"
}
Else { Write-Host "The registry value does not exist"}
#Get Desktop-config.json
$TeamsFolders = "$env:APPDATA\Microsoft\teams"
try{
$SourceDesktopConfigFile = "$TeamsFolders\desktop-config.json"
$desktopConfig = (Get-Content -Path $SourceDesktopConfigFile | ConvertFrom-Json)
}
catch{ Write-Host "Failed to open Desktop-config.json" }
#Overwrite the desktop-config.json
Write-Host "Modify desktop-Config.Json"
try{
$desktopConfig.isLoggedOut = $true
$desktopConfig.upnWindowUserUpn =""; #The email used to sign in
$desktopConfig.userUpn ="";
$desktopConfig.userOid ="";
$desktopConfig.userTid = "";
$desktopConfig.homeTenantId ="";
$desktopConfig.webAccountId="";
$desktopConfig | ConvertTo-Json -Compress | Set-Content -Path $SourceDesktopConfigFile -Force
}
catch{ Write-Host "Failed to overwrite desktop-config.json" }
Write-Host "Modify desktop-Config.Json - Finished"
#Lastly delete the storage.json, this corrects some error that MSTeams otherwise would have when logging in again.
Get-ChildItem "$TeamsFolders\storage.json" | Remove-Item
- rahulnpatil918Feb 04, 2023Copper Contributor
gardenzwerg Thanks. The script worked for me.
- Jainam_Chheda03Nov 30, 2021Copper Contributor
Hey!! Thanks alot for this! The script code worked and the problem was solved!!!