Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine Domain and username used to map a network drive

Using Windows 7 Enterprise with SP1, but I'm hoping to get a generic answer that would apply to Windows XP/2003/2008/Vista/7.

From a command prompt, I execute a net use command to map the Z: drive to a share on another computer, but I don't use my current credentials, I specify a different domain and user to map the drive.

 net use z: \\rd-pc2037\C_DRIVE password /user:rd-pc2037\Administrator 

The command completes successfully. Now that the drive is mapped, how can I find what Domain and Username I used to successfully map the drive? I can't seem to find what I want with the net use command.

 C:\Users\rdomarat>net use  New connections will not be remembered.  Status       Local     Remote                    Network ----------------------------------------------------------------------------  OK           Z:        \\rd-pc2037\C_DRIVE       Microsoft Windows Network  The command completed successfully.  C:\Users\rdomarat>net use Z:  Local name        Z:  Remote name       \\rd-pc2037\C_DRIVE  Resource type     Disk  Status            OK # Opens           0 # Connections     1  The command completed successfully. 

Checking the properties of the share in Windows Explorer and looking at the security tab showed me what permissions different people would have, but I didn't see how which DOMAIN\User I had used. I searched through the registry with limited success as well.

Any thought?

like image 856
Reg Domaratzki Avatar asked Jan 27 '12 17:01

Reg Domaratzki


People also ask

How do I find my mapped drive credentials?

Open Control Panel, Credential Manager, Windows Credentials tab. Server Credentials are stored here. The login credential is there, along with the Server it belongs to.

How do I find my network drive name?

To check the path of a network drive using File Explorer, click on 'This PC' on the left panel in Explorer. Then double-click the mapped drive under 'Network Locations'. The path of the mapped network drive can be seen at the top.


2 Answers

WMI is your friend:

> wmic netuse where LocalName="Z:" get UserName /value

UserName=rd-pc2037\Administrator 
like image 152
TerDale Avatar answered Sep 22 '22 12:09

TerDale


None of these answers help when using alternate credentials. They only show the current, local user. That doesn't help.

To view all stored credentials, use...

rundll32.exe keymgr.dll, KRShowKeyMgr 
like image 42
John Suit Avatar answered Sep 25 '22 12:09

John Suit