Get users mapped network drives from a service

121 Views Asked by At

I have a windows service that I use to monitor PC stats and health and one of its features is monitoring hard drive space. But I would also like to keep an eye on mapped network drives as well.

System.IO.DriveInfo contains everything I need, however, mapped network drives are only accessible when called from a console app running with user permissions. When DriveInfo.GetDrives() is called from a service, only physical drives are returned. I understand the reason for this, but is there any way to work around it and get free space for a logged-in user's mapped drives from a windows service?

0

There are 0 best solutions below