Windows Credential Manager won't clear credentials with multiple users

0

For several websites and file sharing to a third party domain I am using Windows Credentials to perform automatic logon if required (the users I have are not part of that third party domain so SSO is not an option). We are running automated tasks which are currently configured to do the following:

  1. Clear out the Windows Credential Manager with "cmdkey /delete:xxxx"
  2. Drop all network connections with "net use * /DELETE /Y"
  3. Remove cached Internet Explorer entries with "InetCpl.cpl,ClearMyTracksByProcess 2"
  4. Clear Google Chrome cache by deleting cookie file
  5. Set new credentials using "cmdkey /add:xxxx /user:DOMAIN\xxxx /pass:xxxx"
  6. Run the actual automated task

It already took a while to compile this list of pre-tasks but it's still not enough. On production systems this works fine. There's only 1 user logged in at all times.

Though, the problem occurs on development machines where multiple users could be logged in at the same time. If multiple users are logged in, then credentials seem to be cached. If User A logs in and tests the automated task thus performing the clearing and setting of new credentials, then User B (who logs in later than User A) is forced to use User A's set credentials. Clearing the credentials does not seem to be enough anymore. Even manually clearing the Windows Credential Manager still forces Windows to use the credentials stored by User A before.

This problem is especially appearing in Windows Explorer (when accessing shared drives). Is there any other step I need to perform to really clear out the credentials from the system or something that I miss? A complete alternative is also fine because I realize the above solution is complete garbage, but it's the only working solution I could get.

John Smith

Posted 2019-04-24T06:28:44.033

Reputation: 143

No answers