Possible to purge credentials to remap drives using different credentials without logging out?

2

1

I have two different accounts on a WebDAV server for various reasons, basically along the lines of personal files in one and work/school-type related files in another. Everything is wiped upon reboot, so I have a length PowerShell script to setup my environment and a batch script that merely maps the proper WebDAV drives. I have it setup to ask for y/n and map one set of drives on y and another set on n.

Generally, I only do personal work in one session or non-personal work in one session, but sometimes I am at a workstation for several hours and may eventually switch gears. It's a hassle to logout and log back in (and it takes several minutes), and I usually have many tabs open in a browser that would be cumbersome to reopen.

I tried deleting the cached credentials in Credential Manager like this answer suggested: by going to rundll32.exe keymgr.dll, KRShowKeyMgr and then deleting the entry there.

After doing this, I was still able to access the drives I had mapped. So, I manually disconnected the drives and reran the batch script.

However, indicating that I wanted to map the other set of drives did nothing. When I tried mapping the same drives again, they mapped without prompting me for credentials, even though Credential Manager was empty!

Is there somewhere besides Credential Manager, in addition to what the aforementioned answer instructed, that I need to go to in order to properly delete the credentials, so I can remap as if from a fresh login?

Proposed Solutions That Don't Work:

  • Using net use * delete does not work.
  • Using for /F "tokens=1,2 delims= " %G in ('cmdkey /list ^| findstr Target') do cmdkey /delete %H also does not work.
  • Using the IP address of the server to map the folder instead of the domain name. I have heard this can work to get around this restriction for LAN servers. The server is d.docs.live.net and when I try mapping using IP address, this fails. Otherwise, I wouldn't mind doing this is I have no problem mapping both sets of drives simultaneously either.

InterLinked

Posted 2018-07-10T03:31:18.483

Reputation: 1 761

@PimpJuiceIT Windows 10. Tried everything in your first comment, it did not work. I tried clearing credits and then doing the commands and then the other way around and neither way worked. When I run the batch script with the n switch, it automatically remaps the same drive without prompting for credits, despite CredMangager being empty and no active net use connections – InterLinked – 2018-07-12T02:54:32.267

11.) Okay, I'm not certain if this will work or not because I can't test myself right now but d.docs.live.net has DNS aliases as per the nslookup results so not sure if one of those names would work in place of d.docs.live.net but you can easily test this with these aliases just in case. From admin elevated cmd run nslookup d.docs.live.net and you can copy the aliases and use those in lieu: https://i.imgur.com/siXacfT.png – Pimp Juice IT – 2018-07-12T03:52:05.107

@PimpJuiceIT For your first suggestion: I tried all of the ones in your screenshot. The first time I would try to use one of them, I got System error 1790 (The network logon has failed). After that I got System error 59 (An unexpected error has occurred). I would like to do #1 if that can be gotten to work; #2 would be way too much hassle: no admin rights and everything is wiped. – InterLinked – 2018-07-12T20:15:48.380

@PimpJuiceIT If I supply the password in the script (which I wouldn't do normally) I get System error 1244 has occurred.

The operation being requested was not performed because the user has not been authenticated. – InterLinked – 2018-07-12T20:23:24.243

@PimpJuiceIT Tried PowerShell too, just get The operation being requested was not performed because the user has not been authenticated. – InterLinked – 2018-07-12T20:30:49.263

@PimpJuiceIT And if I use backlashes instead of URL format then I get `System error 53 has occurred.

The network path was not found.` – InterLinked – 2018-07-12T20:32:56.683

I'm out of ideas but not having the admin access is a bit limiting indeed. Maybe there is a client out there like the NetDrive but that is install free that allow the mapping with specific credential and via WebDAV. – Pimp Juice IT – 2018-07-12T23:30:18.020

No answers