Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell if a mapped drive was mapped as an Administrator or Standard User With C#?

As I understand it, a mapped drive isn't available to a standard user when it was created by an administrator and vice versa. Is there a way to tell programatically how the drive was mapped? By an Admin or by a standard user? I know about the Registry entry EnableLinkedConnection, which allows mapped drives to be available to all, but I don't want that to be necessary.

EDIT: Here's a scenarios I'm running into. A drive is mapped as an administrator. But a program running with standard rights can't see that drive.

Thanks

like image 780
JimDel Avatar asked Dec 11 '12 18:12

JimDel


People also ask

How do you see what credentials a mapped drive is using?

If you are an administrator on the server you can open the computer management snapin and view sessions under shared folders. This will show you which user credentials were used. To open the snapin, use Windows Explorer and right click on "This Computer" and select manage.

What does C$ mean when mapping a network drive?

The $ designates an administrative share. For example, C$ represents the C: volume on the remote computer. Administrative shares also allow access to other resources, such as printers connected to the remote machine ( print$ ).

How do I trace a network drive?

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.

Do you need admin access to map a network drive?

In order to map a network drive, the user will need an account on both the machine they will be using and the main admin server machine with the same username and password.


1 Answers

I assume your code is running on a Windows7 or newer box.

As Sorceri hints in his comment, your app might be running under standard rights, and you used elevated rights to map the drive.

If this is the case, you have 2 solutions:

  1. Either set the program to run with higher privileges

  2. Check the share and file security on the share you are mapping.

Hopes this helps.

like image 137
mrGrandelag Avatar answered Oct 20 '22 01:10

mrGrandelag