badtutta / CacheClean

0 stars 0 forks source link

Request: Add more cleanup for OneDrive #1

Closed brmcmill closed 9 months ago

brmcmill commented 1 year ago

Hey @badtutta -- I do think for the OneDrive option, adding these pieces will truly clean things up for OneDrive. Sometimes that's been a challenge when users have Sync issues, so running this solution seems to fix it. Overall awesome stuff so far!

Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Recurse -Force | Out-Null
& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe" /reset | Out-Null
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive\Settings\" -Recurse -Force | Out-Null
Start-Sleep 5
& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe"
badtutta commented 1 year ago

Done.

Oddly had that in first version but removed it because I thought it not needed. Good to know I was wrong.

Thanks.

Looks like the cache folder I delete for PowerBI is correct. Not sure if that is all I need though.

Also, Robert could not access system variables in his system as it was too locked down. %LOCALAPPDATA% returned nothing for him. May have been because of lock down and script may be able to bypass all that.

This is why we test.

Brad Tucker | Senior Consultant II | Microsoft Services

Phone: 678-629-5224 Cell: 404-427-1435 Fax: 678-629-5271

www.microsoft.com/serviceshttp://www.microsoft.com/services


From: Brandon McMillan @.> Sent: Wednesday, March 1, 2023 7:29:43 PM To: badtutta/CacheClean @.> Cc: Brad Tucker @.>; Mention @.> Subject: [badtutta/CacheClean] Request: Add more cleanup for OneDrive (Issue #1)

Hey @badtuttahttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbadtutta&data=05%7C01%7Cbrad.tucker%40microsoft.com%7C5ed3c328c6e744a6350408db1abd9a3d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638133173881266874%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xb0Mazn80h0wuFamUahJQ1Tp3tXsJg6bWfTtKiKTEiE%3D&reserved=0 -- I do think for the OneDrive option, adding these pieces will truly clean things up for OneDrive. Sometimes that's been a challenge when users have Sync issues, so running this solution seems to fix it. Overall awesome stuff so far!

Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Recurse -Force | Out-Null & "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe" /reset | Out-Null Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive\Settings\" -Recurse -Force | Out-Null Start-Sleep 5 & "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe"

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbadtutta%2FCacheClean%2Fissues%2F1&data=05%7C01%7Cbrad.tucker%40microsoft.com%7C5ed3c328c6e744a6350408db1abd9a3d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638133173881266874%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=O1RT83Bc3ayMMG9A2pCrwY1GKkt%2Fyd3%2B3%2FzOVO9OGhU%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA5OJUGQK5FDKS4UEG7FRQILWZ7ZYPANCNFSM6AAAAAAVMYLL3E&data=05%7C01%7Cbrad.tucker%40microsoft.com%7C5ed3c328c6e744a6350408db1abd9a3d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638133173881266874%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=w7UA1jQXZawPhlH7nNjbGQj6uHgLgJlUFkwj3%2FIlMpg%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

brmcmill commented 1 year ago

Hey @badtutta -- have an update to the OneDrive cleanup. This might work better now for Windows 11.


Get-Process "OneDrive" -ErrorAction SilentlyContinue | kill -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Remove-Item -Path "$env:LOCALAPPDATA\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe" /reset | Out-Null
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive\Settings\" -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
Start-Sleep 5
& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe"
badtutta commented 1 year ago

Cool. Thanks.

Will add that. What is the verdict on using shortcuts? Should I change them to some other mechanism or do we think we can get an exception?

Brad Tucker | Senior Consultant | Microsoft Services Phone: 678-629-5224 Cell: 404-427-1435 Fax: 678-629-5271

www.microsoft.com/serviceshttp://www.microsoft.com/services

From: Brandon McMillan @.> Sent: Monday, April 24, 2023 9:40 PM To: badtutta/CacheClean @.> Cc: Brad Tucker @.>; Mention @.> Subject: Re: [badtutta/CacheClean] Request: Add more cleanup for OneDrive (Issue #1)

Hey @badtuttahttps://github.com/badtutta -- have an update to the OneDrive cleanup. This might work better now for Windows 11.


Resets OneDrive for a Logged on User

Get-Process "OneDrive" | kill -Force -ErrorAction SilentlyContinue | Out-Null

Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Recurse -Force | Out-Null

Remove-Item -Path "$env:LOCALAPPDATA\OneDrive" -Recurse -Force | Out-Null

& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe" /reset | Out-Null

Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive\Settings\" -Recurse -Force | Out-Null

Start-Sleep 5

& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe"

- Reply to this email directly, view it on GitHubhttps://github.com/badtutta/CacheClean/issues/1#issuecomment-1521081603, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5OJUGSTJ4QYQZFJBUOPD33XC42RRANCNFSM6AAAAAAVMYLL3E. You are receiving this because you were mentioned.Message ID: @.***>

brmcmill commented 1 year ago

Just got back today, so I'll see if I'll check it out more tomorrow.

Best Regards,

From: badtutta @.> Sent: Monday, April 24, 2023 9:43 PM To: badtutta/CacheClean @.> Cc: Brandon McMillan @.>; Author @.> Subject: Re: [badtutta/CacheClean] Request: Add more cleanup for OneDrive (Issue #1)

Cool. Thanks.

Will add that. What is the verdict on using shortcuts? Should I change them to some other mechanism or do we think we can get an exception?

Brad Tucker | Senior Consultant | Microsoft Services Phone: 678-629-5224 Cell: 404-427-1435 Fax: 678-629-5271

www.microsoft.com/serviceshttp://www.microsoft.com/services<http://www.microsoft.com/services%3chttp:/www.microsoft.com/services>

From: Brandon McMillan @.<mailto:@.>> Sent: Monday, April 24, 2023 9:40 PM To: badtutta/CacheClean @.<mailto:@.>> Cc: Brad Tucker @.<mailto:@.>>; Mention @.<mailto:@.>> Subject: Re: [badtutta/CacheClean] Request: Add more cleanup for OneDrive (Issue #1)

Hey @badtuttahttps://github.com/badtutta -- have an update to the OneDrive cleanup. This might work better now for Windows 11.


Resets OneDrive for a Logged on User

Get-Process "OneDrive" | kill -Force -ErrorAction SilentlyContinue | Out-Null

Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\OneDrive" -Recurse -Force | Out-Null

Remove-Item -Path "$env:LOCALAPPDATA\OneDrive" -Recurse -Force | Out-Null

& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe" /reset | Out-Null

Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive\Settings\" -Recurse -Force | Out-Null

Start-Sleep 5

& "$env:ProgramFiles\Microsoft OneDrive\OneDrive.exe"

- Reply to this email directly, view it on GitHubhttps://github.com/badtutta/CacheClean/issues/1#issuecomment-1521081603, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5OJUGSTJ4QYQZFJBUOPD33XC42RRANCNFSM6AAAAAAVMYLL3E. You are receiving this because you were mentioned.Message ID: @.<mailto:@.>>

- Reply to this email directly, view it on GitHubhttps://github.com/badtutta/CacheClean/issues/1#issuecomment-1521083460, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGMDNT54ZENDRLK6KVNDR73XC423JANCNFSM6AAAAAAVMYLL3E. You are receiving this because you authored the thread.Message ID: @.**@.>>

brmcmill commented 9 months ago

This can be closed.