0

I have a need to be able to remove onedrive cached credentials from local machines from the windows credential manager using a script The reason - When a user is prompted to change their O365 password for some reason the local cached version of the password linked to OneDrive doesn't update and users start to get Sync errors.

The user could go and manually remove this entry but for some this is asking alot ;)

Any pointers would be great. Prefer Powershell but VB is ok too.

Regards

  • Related: [How to clear credentials associated with the OneDrive for Business sync app?](http://superuser.com/questions/767003/how-to-clear-credentials-associated-with-the-onedrive-for-business-sync-app?rq=1) – Ƭᴇcʜιᴇ007 Jan 14 '15 at 17:48
  • What has you research shown you so far? Have you seen this yet? http://windowsitpro.com/systems-management/q-how-can-i-selectively-clear-cached-credentials-my-windows-client Have you made any actual attempts at scripting this yet? If so, where exactly are you getting stuck? – Ƭᴇcʜιᴇ007 Jan 14 '15 at 17:49
  • In Credential Manager, there is [OneDrive Cache Credential](http://i.imgur.com/PIvfJoN.png), but this is for OneDrive Personal. For OneDrive Business, it might be listed as SharePoint. Might review your Credentials and see if it is SharePoint. – Sun Jan 14 '15 at 18:21

1 Answers1

1

Windows comes with a command-line utility for the Credential Manager component: cmdkey

I don't have a OneDrive for Business account to test with, but you should see cached credentials in the output of:

cmdkey /list

Use PowerShell to grab the ouput from /list, extract the target name and call

cmdkey /delete:targetname
Mathias R. Jessen
  • 452
  • 1
  • 5
  • 15