Windows – NET USE – How to get list of all shares (elevated, non-elevated)

net-usenetwork-shareuser-permissionswindowswindows-command-prompt

The command:

NET USE

Will display open connections by any process of current user. But, if command prompt (cmd.exe, or any shell) is non-elevated, it would display only connections opened by non-elevated processes. To see shares open by elevated processes, we need to use Command Prompt elevated.

How to view all shares/connections opened by same user (i.e. current user) – irrespective of elevation of processes which opened the remote share (for example, from (non-elevated) Windows Explorer) ?

Best Answer

There isn't built-in functionality to do what you're looking for. The elevated context's "mappings" are separate from the limited-user context, as you're seeing. You could write a script to perform the NET USE as both the limited and elevated contexts and concatenate the results, but there's no single API or command-line tool that I'm aware of that does what you're looking for.