Thursday, March 19, 2015

Check the credential of mapped network drive by WMI

Assuming that you'd like to know the user name of mapped network drive. The easy way to find the user name by performing wmic on Command Prompt or PowerShell.

wmic netuse where localname="<Drive letter name>" get UserName /value

You don't need to provide administrator's credential to perform this command.To check the user name by PowerShell, we can perform the following cmdlets.Get-WmiObject -Class Win32_NetworkConnection | Select UserName