%3CLINGO-SUB%20id%3D%22lingo-sub-1520725%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520725%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20need%20both%20get-childitems%3F%3CBR%20%2F%3E%3CBR%20%2F%3EWhy%20not%20just%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EGet-ChildItem%20%22C%3A%5CUsers%5C*%5CAppData%5CRoaming%5CMicrosoft%5CTeams%22%20-Directory%7C%20xxxx%3C%2FPRE%3E%3CP%3Einstead%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520809%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520809%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F220820%22%20target%3D%22_blank%22%3E%40Terry%20Wrennall%3C%2FA%3E%26nbsp%3Bthe%20MS%20Teams%20cache%20resides%20in%20multiple%20directories%20hence%20the%20multiple%20get-childitems%20call.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520862%22%20slang%3D%22de-DE%22%3ESubject%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520862%22%20slang%3D%22de-DE%22%3E%3CP%3EAs%20get-childitem%20piped%20to%20get-childitem%20does%20not%20work%20in%20our%20Infra%2C%20i%20changed%20the%20script%20to%20take%20only%20the%20current%20user%3A%3C%2FP%3E%3CPRE%3EGet-ChildItem%20-Path%20%22C%3A%5CUsers%5C%24env%3AUserName%5CAppData%5CRoaming%5CMicrosoft%5CTeams%22%20-Directory%7CWhere%7B%24_%20-in%20('Cache'%2C'databases'%2C'blob_storage'%2C'IndexedDB'%2C'')%7D%7CForEach%7BRemove-Item%20%24_.FullName%20-Recurse%20-Force%7D%3C%2FPRE%3E%3CP%3ESo%20every%20user%20would%20be%20able%20to%20kill%20his%20own%20cache%20only.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EPawel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520884%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520884%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F447171%22%20target%3D%22_blank%22%3E%40pkwdr%3C%2FA%3E%26nbsp%3BThank%20you%20for%20the%20share.%26nbsp%3B%20Different%20installations%20would%20have%20different%20cache%20storage%20paths%20so%20it%20is%20possible%20the%20script%20would%20need%20to%20be%20modified%20as%20required.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520889%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520889%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F220820%22%20target%3D%22_blank%22%3E%40Terry%20Wrennall%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F447171%22%20target%3D%22_blank%22%3E%40pkwdr%3C%2FA%3E%26nbsp%3BI%20modified%20the%20script%20based%20on%20both%20your%20feedback%20to%20create%20a%20more%20baseline%26nbsp%3B%3CSPAN%3Eget-childitem%20allowing%20readers%20to%20customize%20as%20needed.%26nbsp%3B%20Thank%20you%20both%20again%20for%20sharing%20your%20ideas.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1519118%22%20slang%3D%22en-US%22%3EPowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1519118%22%20slang%3D%22en-US%22%3E%3CP%3ESometimes%20there%20is%20a%20need%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Ftroubleshoot-installation%3FWT.mc_id%3DITOPSTALK-blog-abartolo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edelete%20Microsoft%20Teams%20cache%3C%2FA%3E%20to%20quicken%20the%20adoption%20of%20an%26nbsp%3Bin-band%20policy%20change%20or%20simply%20troubleshoot%20an%20issue.%20The%20challenge%20here%20is%20that%20the%20cache%20for%20Microsoft%20Teams%20is%20in%20multiple%20directories.%20This%20can%20be%20done%20manually%20but%20would%20result%20in%20a%20slow%20and%20tedious%20process.%20Again%2C%20we%20turn%20to%20PowerShell%20to%20automate%20this%20process%20and%20this%20time%20it's%20a%20%3CEM%3E%3CEM%3Eone-liner%3C%2FEM%3E%3C%2FEM%3E%20that%20addresses%20this%20opportunity.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EGet-ChildItem%20%22C%3A%5CUsers%5C*%5CAppData%5CRoaming%5CMicrosoft%5CTeams%5C*%22%20-directory%20%7C%20Where%20name%20-in%20('application%20cache'%2C'blob%20storage'%2C'databases'%2C'GPUcache'%2C'IndexedDB'%2C'Local%20Storage'%2C'tmp')%20%7C%20ForEach%7BRemove-Item%20%24_.FullName%20-Recurse%20-Force%20-WhatIf%7D%0A%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20end%20of%20the%26nbsp%3B%3CEM%3Eone-liner%26nbsp%3B%3C%2FEM%3Ecalls%20a%26nbsp%3B-WhatIf%20which%20can%20be%20removed%20to%20enforce%20deletion.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAs%20always%2C%20please%20share%20your%20comments%20below%20on%20bettering%20the%20above%20script%20or%20any%20questions%20you%20may%20have.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1519118%22%20slang%3D%22en-US%22%3E%3CP%3ESometimes%20there%20is%20a%20need%20to%20delete%20Microsoft%20Teams%20cache%20to%20quicken%20the%20adoption%20of%20an%26nbsp%3Bin-band%20policy%20change%20or%20simply%20troubleshoot%20an%20issue.%20The%20challenge%20here%20is%20that%20the%20cache%20for%20Microsoft%20Teams%20is%20in%20multiple%20directories.%20This%20can%20be%20done%20manually%20but%20would%20result%20in%20a%20slow%20and%20tedious%20process.%20Again%2C%20we%20turn%20to%20PowerShell%20to%20automate%20this%20process%20and%20this%20time%20it's%20a%20one-liner%20that%20addresses%20this%20opportunity.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PowerShell_Basics.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F134944iD72B3B0B8F4E0886%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22PowerShell_Basics.jpg%22%20alt%3D%22PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EPowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1519118%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAnthony%20Bartolo%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522208%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522208%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%20Teams%20require%20to%20be%20closed%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522216%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522216%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411460%22%20target%3D%22_blank%22%3E%40Jgq85%3C%2FA%3E%26nbsp%3BYes%20it%20would%20be%20recommended%20that%20Teams%20should%20be%20closed%20when%20clearing%20the%20cache.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522242%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522242%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Anthony%2C%20we%20are%20using%20teams%20on%20vdi.%20After%208%20to%2010%20hrs%20teams%20take%20all%20the%20memory%20even%2010%20gb.%20There%20seems%20to%20be%20memory%20leak%20issue%20with%20teams.%20Does%20this%20release%20memory%20also.%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522253%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522253%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20how%20you%20gonna%20close%20a%20user%20lol.%20What%20if%20they're%20on%20a%20call%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522247%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522247%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20a%20stop%20process%20in%20there%20(to%20close%20Teams)%2C%20using%20the%20AppData%20Env%20Variable%3C%2FP%3E%3CPRE%3EStop-Process%20-Name%20Teams%3B%20Get-ChildItem%20-Path%20%24env%3AAppData%5CMicrosoft%5CTeams%20-Directory%7CWhere%7B%24_%20-in%20('Cache'%2C'databases'%2C'blob_storage'%2C'IndexedDB'%2C'')%7D%7CForEach%7BRemove-Item%20%24_.FullName%20-Recurse%20-Force%7D%3C%2FPRE%3E%3CP%3Ewith%20some%20shorthands%3A%3C%2FP%3E%3CPRE%3Espps%20-Name%20Teams%3B%20gci%20%24env%3AAppData%5CMicrosoft%5CTeams%20-Directory%20%7C%20%3F%20%7B%20%24_%20-in%20('Cache'%2C'databases'%2C'blob_storage'%2C'IndexedDB'%2C'')%20%7D%20%7C%20%25%20%7B%20Remove-Item%20%24_.FullName%20-Recurse%20-Force%20%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522274%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522274%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F483892%22%20target%3D%22_blank%22%3E%40techienick%3C%2FA%3E%26nbsp%3Bfor%20the%20share.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522278%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522278%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411460%22%20target%3D%22_blank%22%3E%40Jgq85%3C%2FA%3E%26nbsp%3Bhave%20a%20look%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F483892%22%20target%3D%22_blank%22%3E%40techienick%3C%2FA%3E's%20script%20share.%26nbsp%3B%20It%20would%20also%20be%20good%20practice%20to%20share%20notification%20with%20your%20users%20as%20to%20when%20the%20clean-up%20would%20occur.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522283%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522283%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F728668%22%20target%3D%22_blank%22%3E%40ShahGdubai315%3C%2FA%3E%26nbsp%3Bthis%20unfortunately%20does%20not%20release%20memory.%26nbsp%3B%20Let%20me%20look%20and%20see%20if%20thier%20is%20a%20solution%20for%20that%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522298%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522298%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20would%20be%20gr8%20help%20if%20we%20can%20release%20memory.%20Its%20hogging%20all%20memory.%20We%20have%2010%20gb%20ram%20for%20each%20virtual%20machine%20and%20after%20a%20day%20it%20slowly%20takes%20all%20the%20memory%20and%20not%20releasing%20back.%20We%20have%20100%20vm%20machines%20and%20we%20need%20to%20reboot%20machines%2C%20its%20driving%20us%20crazy.%3C%2FP%3E%3CP%3EMany%20thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522318%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522318%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20Microsoft%20Teams%20uses%20memory%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-memory-usage-perf%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-memory-usage-perf%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EClearing%20cache%20doesn't%20really%20fix%20%22memory%22%20issues.%20I've%20actually%20seen%20memory%20usage%20go%20UP%20after%20clearing%20folders%2Ffiles.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20uses%20memory%20based%20on%20memory%20available.%3C%2FP%3E%3CP%3ETry%20running%20Teams%20on%20a%20VM%20that%20has%208%20GB%20of%20memory%2C%20then%20on%20one%20with%2016%20GB%20of%20memory%20the%20on%20one%20with%2032%20GB%20of%20memory.%20I'm%20betting%20if%20you%20leave%20it%20running%20as%20the%20same%20user%20for%20the%20same%20amount%20of%20time%2C%20its%20memory%20usage%20will%20not%20be%20consistent%20due%20to%20hardware%20difference.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20they%20should%20do%20is%20allow%20you%20to%20throttle%20its%20memory%20usage%20if%20it's%20causing%20the%20issue.%26nbsp%3B%20Or%20allow%20you%20to%20only%20be%20loading%2Fshowing%20past%20week%20of%20messages%20to%20hopefully%20reduce%20memory%20usage%20or%20lag.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1522809%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1522809%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411460%22%20target%3D%22_blank%22%3E%40Jgq85%3C%2FA%3E%26nbsp%3Bbefore%20we%20had%208%20gb%20of%20ram%20and%20it%20was%20taking%20all.%20Then%20we%20upgraded%20ram%20to%2010%20and%20went%20upto%2012%20gb%20and%2016gb%20but%20still%20the%20same%20whatever%20memory%20we%20assign%20it%20is%20taking%20all%20memory%20available%20in%20vm.%20Why%20MS%20is%20not%20fixing%20this%20big%20memory%20leak%20issue%20which%20is%20there%20future%20product%20which%20will%20b%20replacing%20skype.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3ERight%20now%20the%20only%20solution%20is%20to%20kill%20the%20task%20and%20start%20it%20again.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1523946%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1523946%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20sharing!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1527917%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1527917%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411460%22%20target%3D%22_blank%22%3E%40Jgq85%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F728668%22%20target%3D%22_blank%22%3E%40ShahGdubai315%3C%2FA%3E%26nbsp%3B%20Wow%2C%20is%20it%20worse%20in%20a%20VM%20for%20some%20reason%3F%20On%20a%20PC%20used%20with%20other%20things%2C%20where%20it%20can't%20just%20go%20crazy%20without%20starving%20everything%20else%2C%20it%20does%20seem%20to%20restrain%20itself%2C%20with%20the%20exception%20being%20video%20conferences.%20Is%20that%20how%20you're%20using%20it%20in%20a%20VM%3F%20It's%20Electron%2C%20so%20only%20so%20much%20is%20possible%20in%20terms%20of%20constraint.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1535075%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1535075%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20tried%20the%20same%20but%20the%20cache%20isn't%20cleared%20yet.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22lingitexpress_0-1595320113232.png%22%20style%3D%22width%3A%20892px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F206763i0DC29490C718B1B6%2Fimage-dimensions%2F892x214%3Fv%3D1.0%22%20width%3D%22892%22%20height%3D%22214%22%20title%3D%22lingitexpress_0-1595320113232.png%22%20alt%3D%22lingitexpress_0-1595320113232.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EC%3A%5CUsers%5Cusername%5CAppData%5CRoaming%5CMicrosoft%5CTeams%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20folder%20has%20a%20file%20size%20of%20185%20MB.%26nbsp%3B%20Any%20advice.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F102838%22%20target%3D%22_blank%22%3E%40Anthony%20Bartolo%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1535088%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1535088%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F619142%22%20target%3D%22_blank%22%3E%40lingitexpress%3C%2FA%3Ethat's%20because%20it's%20using%20the%20WhatIf%20parameter%2C%20if%20you%20remove%20the%20WhatIf%20Paremeter%20it%20will%20remove%20the%20files%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1536552%22%20slang%3D%22en-US%22%3ERe%3A%20PowerShell%20Basics%3A%20How%20to%20Delete%20Microsoft%20Teams%20Cache%20for%20All%20Users%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1536552%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F483892%22%20target%3D%22_blank%22%3E%40techienick%3C%2FA%3E%26nbsp%3Bfor%20your%20response.%26nbsp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F619142%22%20target%3D%22_blank%22%3E%40lingitexpress%3C%2FA%3E%26nbsp%3Bremove%20%3CSPAN%3E-WhatIf%20to%20enforce%20deletion%20as%20detailed%20at%20the%20end%20of%20the%20above%20post.%26nbsp%3B%20The%20-WhatIf%20is%20in%20place%20as%20a%20safeguard%20should%20you%20not%20wish%20to%20delete%20but%20only%20report%20on%20what%20cache%20can%20be%20deleted.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Sometimes there is a need to delete Microsoft Teams cache to quicken the adoption of an in-band policy change or simply troubleshoot an issue. The challenge here is that the cache for Microsoft Teams is in multiple directories. This can be done manually but would result in a slow and tedious process. Again, we turn to PowerShell to automate this process and this time it's a one-liner that addresses this opportunity. 

 

Get-ChildItem "C:\Users\*\AppData\Roaming\Microsoft\Teams\*" -directory | Where name -in ('application cache','blob storage','databases','GPUcache','IndexedDB','Local Storage','tmp') | ForEach{Remove-Item $_.FullName -Recurse -Force -WhatIf}

 

The end of the one-liner calls a -WhatIf which can be removed to enforce deletion.

 

As always, please share your comments below on bettering the above script or any questions you may have.

21 Comments

Do you need both get-childitems?

Why not just

 

Get-ChildItem "C:\Users\*\AppData\Roaming\Microsoft\Teams" -Directory| xxxx

instead?

Microsoft

@Terry Wrennall the MS Teams cache resides in multiple directories hence the multiple get-childitems call.

Visitor

As get-childitem piped to get-childitem does not work in our Infra, i changed the Script to take only the current user:

Get-ChildItem -Path "C:\Users\$env:UserName\AppData\Roaming\Microsoft\Teams" -Directory|Where{$_ -in ('Cache','databases','blob_storage','IndexedDB','')}|ForEach{Remove-Item $_.FullName -Recurse -Force}

So every user would be able to kill his own cache only.

 

Regards

Pawel

Microsoft

@pkwdr Thank you for the share.  Different installations would have different cache storage paths so it is possible the script would need to be modified as required.

Microsoft

@Terry Wrennall and @pkwdr I modified the script based on both your feedback to create a more baseline get-childitem allowing readers to customize as needed.  Thank you both again for sharing your ideas.

Contributor

Does Teams require to be closed? 

Microsoft

@Jgq85 Yes it would be recommended that Teams should be closed when clearing the cache.

Occasional Visitor

Hi Anthony, we are using teams on vdi. After 8 to 10 hrs teams take all the memory even 10 gb. There seems to be memory leak issue with teams. Does this release memory also. 

Thanks

Occasional Contributor

With a stop process in there (to close Teams), using the AppData Env Variable

Stop-Process -Name Teams; Get-ChildItem -Path $env:AppData\Microsoft\Teams -Directory|Where{$_ -in ('Cache','databases','blob_storage','IndexedDB','')}|ForEach{Remove-Item $_.FullName -Recurse -Force}

with some shorthands:

spps -Name Teams; gci $env:AppData\Microsoft\Teams -Directory | ? { $_ -in ('Cache','databases','blob_storage','IndexedDB','') } | % { Remove-Item $_.FullName -Recurse -Force }
Contributor

So how you gonna close a user lol. What if they're on a call 

Microsoft

Thank you @techienick for the share.

Microsoft

@Jgq85 have a look at @techienick's script share.  It would also be good practice to share notification with your users as to when the clean-up would occur.

Microsoft

@ShahGdubai315 this unfortunately does not release memory.  Let me look and see if thier is a solution for that issue.

Occasional Visitor

That would be gr8 help if we can release memory. Its hogging all memory. We have 10 gb ram for each virtual machine and after a day it slowly takes all the memory and not releasing back. We have 100 vm machines and we need to reboot machines, its driving us crazy.

Many thanks

Contributor

How Microsoft Teams uses memory: https://docs.microsoft.com/en-us/microsoftteams/teams-memory-usage-perf  

 

Clearing cache doesn't really fix "memory" issues. I've actually seen memory usage go UP after clearing folders/files. 

 

It uses memory based on memory available.

Try running Teams on a VM that has 8 GB of memory, then on one with 16 GB of memory the on one with 32 GB of memory. I'm betting if you leave it running as the same user for the same amount of time, its memory usage will not be consistent due to hardware difference.  

 

What they should do is allow you to throttle its memory usage if it's causing the issue.  Or allow you to only be loading/showing past week of messages to hopefully reduce memory usage or lag. 

 

Occasional Visitor

@Jgq85 before we had 8 gb of ram and it was taking all. Then we upgraded ram to 10 and went upto 12 gb and 16gb but still the same whatever memory we assign it is taking all memory available in vm. Why MS is not fixing this big memory leak issue which is there future product which will b replacing skype.

Thanks

Right now the only solution is to kill the task and start it again.

Microsoft

Thanks for sharing!

Contributor

@Jgq85 @ShahGdubai315  Wow, is it worse in a VM for some reason? On a PC used with other things, where it can't just go crazy without starving everything else, it does seem to restrain itself, with the exception being video conferences. Is that how you're using it in a VM? It's Electron, so only so much is possible in terms of constraint.

New Contributor

I've tried the same but the cache isn't cleared yet.

lingitexpress_0-1595320113232.png

 

C:\Users\username\AppData\Roaming\Microsoft\Teams 

The folder has a file size of 185 MB.  Any advice. @Anthony Bartolo 

 

Occasional Contributor

@lingitexpressthat's because it's using the WhatIf parameter, if you remove the WhatIf Paremeter it will remove the files

Microsoft

Thank you @techienick for your response.  @lingitexpress remove -WhatIf to enforce deletion as detailed at the end of the above post.  The -WhatIf is in place as a safeguard should you not wish to delete but only report on what cache can be deleted.