We are using impersonation by using the LogonUser function from advapi32.dll along with the WindowsIdentity class to perform impersonation.
In the application I want to show all drives that the user normally can see in the windows explorer. Therfore I use the DriveInfo.GetDrives() method. But I only get the local drives, not the drives that were mapped from the network.
How can I achieve this?
Thanks,
Florian
If you’re impersonating the user correctly, then you have access to their network resources. e.g., using UNC paths should work as expected.
I believe there isn’t a supported solution, but you could trudge through the registry for network drive mappings (HKCU\Network) and look up their UNC paths manually.